Click modal window
#23
This allows you to click an activate modal window if default button has been set to enter.
Change the name to the name of the item you want.
There are 3 version to this. Each does it owns thing.
1: clicks a modal window when it has title "teleports" (this needs onModalDialog callback from newest bot.
2: has a toggle button to turn off and on. onModalDialog callback needed. Multi dialog selection.
3: this finds choice with name "Bosses" selects it and then clicks "ok"
Change the name to the name of the item you want.
There are 3 version to this. Each does it owns thing.
1: clicks a modal window when it has title "teleports" (this needs onModalDialog callback from newest bot.
2: has a toggle button to turn off and on. onModalDialog callback needed. Multi dialog selection.
3: this finds choice with name "Bosses" selects it and then clicks "ok"
onModalDialog(function(id, title, message, buttons, enterButton, escapeButton, choices, priority)
if title == "Teleports" then
modules.game_modaldialog.modalDialog:onEnter()
end
end)
- remove | + add
local modalClick = macro(2000, "Auto click Modal", function() end)
onModalDialog(function(id, title, message, buttons, enterButton, escapeButton, choices, priority)
if modalClick:isOff() then return end
local goDialog = 0
if title == "Teleports" then -- clicks choice 4 if title is teleport
goDialog = 4
elseif title == "Misc" then -- clicks button 1 if misc
goDialog = 1
elseif title == "Towns" then -- if is town get all choices and select the one titled Thais
for i = 1, #choices do
local choiceId = choices[i][1]
local choiceName = choices[i][2]
if choiceName == "Thais" then
goDialog = choiceId
end
end
end
if goDialog > 0 then
g_game.answerModalDialog(id, enterButton, goDialog)
modules.game_modaldialog:destroyDialog()
end
end)
- remove | + add
local modalpanel = modules.game_modaldialog.modalDialog
if modalpanel then
local choiceList = modalpanel:getChildById('choiceList')
if choiceList then
for i, widget in pairs(choiceList:getChildren()) do
if (widget:getText() == "Bosses") then
choiceList:focusChild(widget)
modalpanel:onEnter()
end
end
end
end
- remove | + add
10 Jun 2021