I once added some functions to interface/addons/ingamefunctions.lua. One of them is
Code: Select all
------------------------------------------------
-- Select Option By Name
-- optiontext = option text or part of
-- NPC option dialog should already be open
------------------------------------------------
function SelectOptionByName(optiontext)
counter = 1
while RoMScript("GetSpeakOption("..counter..")") do
if string.find(RoMScript("GetSpeakOption("..counter..")"),optiontext,0,"plain") then
sendMacro("ChoiceOption("..counter..");"); yrest(1500);
return true
end
counter = counter + 1
end
return false
endCode: Select all
player:target_NPC("Sturobold");
SelectOptionByName("Silberquell"); yrest(500);Code: Select all
[string "..."]:8: attempt to call global 'SelectOptionByName' (a nil value)With the RoM Update 4.0.5.2467 I completely deleted my bot folder and got MM and rombot by SVN with MM1.02 and rombot revision 675.
I then added some userfunctions to
- \scripts\rom\userfunctions
- \interface\addons\ingamefunctions\ingamefunctions.lua
I use the following additional ingamefunctions in ingamefunctions.lua, but did not test them except "SelectOptionByName" :
Code: Select all
function CheckForBuff(buffname)
function CancelBuff(buffname)
function targetNPC(NPCName)
function BuyItemByName(itemname, num)
function DeleteItemByNameOrId(itemNameOrId,onceOnly)
function SelectOptionByName(optiontext)Thanx
Ric