Command> player:target_NPC("Mar")
We try to find NPC Mar:
We successfully target NPC Marliss Sister and try to open the dialog window.
Command> ChoiceOptionByName("open my bank")
Command> player:target_NPC("Mar")
We try to find NPC Mar:
We successfully target NPC Marliss Sister and try to open the dialog window.
Command> ChoiceOptionByName("a house")
Command> ChoiceOptionByName("prev")
they worked fine for me.
*goes back to sleep*
Remember no matter you do in life to always have a little fun while you are at it
function DailyNotesActivate(questid);
if RoMScript("DailyNotes") then
local realm = string.match((RoMScript("GetCurrentRealm()") or ""),"(%w*)$") or ""
local realmset = RoMScript("(DN_Options_Of_Char."..realm.." ~= nil)")
if realmset then
RoMScript("} DN_Options_Of_Char."..realm..".autoquest=true a={")
else
RoMScript("} DN_Options_Of_Char."..realm.." = {autoquest=true) a={")
end
local aq_accept = RoMScript("(DN_Options_Of_Char."..realm..".aq_accept ~= nil)")
if aq_accept then
RoMScript("} DN_Options_Of_Char."..realm..".aq_accept["..questid.."]=1 a={")
else
RoMScript("} DN_Options_Of_Char."..realm..".aq_accept={["..questid.."]=1} a={")
end
cprintf(cli.blue,"\nDaily Notes Addon is installed and working!\n")
DailyNotesActiveID = questid
DailyNotesActive = true
else
cprintf(cli.red,"\nDaily Notes Addon is not installed!\n")
DailyNotesActive = false
end
end
^ is the function that was being run with the first error print I got.
2nd one might have been RoMScript("StaticPopup_OnClick(StaticPopup1, 1);") or until RoMScript("StaticPopup1:IsVisible()"). They are the only RoMScript it uses once as its leaving.
rock5 wrote:DailyNotes is actually a table so now it actually returns the table and it's probably complex enough that it causes some error
Holy crap. You got that right lol, I tried a simple print(RoMScript("DailyNotes")). Took agesssss to do anything, but when it did it was a massive wall of text which I couldn't even scroll back to the top of haha.
[string "return {_uilua.lightuserdate="userdata: 33B4D..."]:1: '}' expected near '='
I updated my KS bots to 775, got this exact same error (diff userdata) on the first player:merchant, didn't seem to affect the selling though.
Getting it on every bot, every time.
Remember no matter you do in life to always have a little fun while you are at it
Seems that RoMScript("CloseWindows()") returns a table when closing windows. First question would be, why would it error? I'll have to look into it. Second problem is, this is an issue that a command unexpectedly returns a table. This happens to be a small table but it could cause performance issues if a command unexpectedly returned a massive table. I think it may have to become common practice to use RoMCode when executing a command and not expecting a return value. That way if there is an unexpected returned value such as a table, it will be ignored. But I expect this will cause some problems in the short term. I'm open to other suggestions for solving this.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
rock5 wrote:I think it may have to become common practice to use RoMCode when executing a command and not expecting a return value.
So basically if you want a value returned use RoMScript and if you are just executing a function use RoMCode ?
That will be relatively easy to use notepad++ and it's search in files option,
replace all RoMScript with RoMCode and then do
search for
= RoMCode
replace with
= RoMScript
That will probably get them easily.
issue would only be if they have varying spaces
=RoMScript
= RoMScript
but could just do a search for them afterwards, I doubt there would be any.
Hmm then need to check for
if RoMScript
and
not RoMScript
ugggh
Remember no matter you do in life to always have a little fun while you are at it
Good work. Looks like you missed a couple in functions.lua (lines 1599,1609), 1 in settings.lua (line 1058).
You have to be careful with that method you described as romcode can return a value so you have to make sure that no existing romcodes get changed to romscripts. Eg.
RoMScript("ToggleBackpack(), BagFrame:Hide()"); -- Make sure the client loads the tables first.
RoMScript("GoodsFrame:Show(), GoodsFrame:Hide()"); -- Make sure the client loads the tables first.
Maybe because it is doing 2 different functions in the last 2.
Remember no matter you do in life to always have a little fun while you are at it
That's a strange one. I know why it errors but I don't know why it sends "xxxx". As far as I can tell that does nothing. It can probably just be changed to
RoMScript("ToggleBackpack(), BagFrame:Hide()"); -- Make sure the client loads the tables first.
RoMScript("GoodsFrame:Show(), GoodsFrame:Hide()"); -- Make sure the client loads the tables first.
The reason these fail when changed to RoMCode is because as RoMScripts they effectively become
RoMScript("ToggleBackpack() BagFrame:Hide()"); -- Make sure the client loads the tables first.
RoMScript("GoodsFrame:Show() GoodsFrame:Hide()"); -- Make sure the client loads the tables first.
And still I missed those two. You're obviously being more thorough than me.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
RoMCode("ChatFrame1:AddMessage(\"MACRO test: successful\");");
RoMCode("ToggleBackpack() BagFrame:Hide()"); -- Make sure the client loads the tables first.
RoMCode("GoodsFrame:Show() GoodsFrame:Hide()"); -- Make sure the client loads the tables first.
These seemed to work ok.
Remember no matter you do in life to always have a little fun while you are at it
In regards to the error that CloseWindows() caused, it was because of the dot in the key names, eg. _uilua.lightuserdate=. I'm of 2 minds on what to do about this. I've already made a change that turns _uilua.lightuserdate= into ["_uilua.lightuserdate"]= which works but it brings up the issue that a key name can be made of nearly any characters even special characters that would cause errors unless used with ["name"]. To be absolutely sure that a table is converted to a valid load string we could just use [" and "] with every string key but that would add 4 characters for every table entry to the length. It would be good if there was a way to tell if the name is valid, if so it could use name=, if not it can use ["name"]. Maybe I could just check for any non alpha/numeric/underscore character. I'd also have to check if the first character is a letter. Hm.. can be done.
Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
Hi ppl! IDK if I'm posting in the right place. I have a problem with sendPartyChat. With the new revision sendPartyChat dosn't work. Error coming in line 270 of party.lua (_whispname is a nil value). So I change my party.lua from
function sendPartyChat(_msg)
if settings.profile.options.MONITOR_WHISPERS then
else
RoMScript("SendChatMessage('".._msg.."', 'WHISPER',0,'".._whispname.."')")
end
cprintf(cli.blue,_msg.."\n")
end
function sendPartyChat(_msg)
if settings.profile.options.MONITOR_WHISPERS then
RoMScript("SendChatMessage('".._msg.."', 'WHISPER',0,'".._whispname.."')")
else
RoMScript("SendChatMessage('".._msg.."', 'PARTY')")
end
cprintf(cli.blue,_msg.."\n")
end
Now work fine.
I cant be more especific becouse I'm pretty bad with english languaje. Sorry for that.
Not sure how that happened, the file I uploaded was exactly like that, so not Rock's fault but for me to upload that is just embarrasing.
I would add in an extra line, _whispname is gotten from who ever whispers you but if for some reason the bot is told to post a message before someone whispers it then it won't have a name to whisper.
function sendPartyChat(_msg)
if settings.profile.options.MONITOR_WHISPERS then
if not _whispname then cprintf(cli.red,"You don't have a name for someone to whisper.\n") return end
RoMCode("SendChatMessage('".._msg.."', 'WHISPER',0,'".._whispname.."')")
else
RoMCode("SendChatMessage('".._msg.."', 'PARTY')")
end
cprintf(cli.blue,_msg.."\n")
end
Remember no matter you do in life to always have a little fun while you are at it
My head is a little less gooey now, so working on fixing this whisper issue.
Reason I haven't just commited the code I posted earlier is because I just don't like it.
The way I have it set up is that if someone whispers you then that name is used when you use sendPartyChat but if no one has whispered you then it has no name to send the whisper to, only way this could happen is if you use sendPartyChat it yourself in a WP or userfunction. The other issue is that if some random player whispers you then when you use sendPartyChat it will send it to them.
Example.
Using party bot and from leader char you tell the party bots to use a NPC to repair and such, they start to repair and this may take 5-10 second, in that short time if some random whispers you then the _whispname changes to them and so when the party bot is done repairing it whispers that random player that it has finished selling.
Note that all of this hinges on the profile having MONITOR_WHISPERS set to true, if it isn't set to true then there is no issue and it will just use party chat as I always intended.
Chances of this happening is pretty small but it is possible, generally people use party bot when they are controlling the leader character in the party aswell so this can be picked up on. If not manually playing leader then this could cause an issue.
So in short I don't like it but there is a very very very very small chance it may cause issues and to avoid that chance would require more work and effort than I feel is needed for this.
I guess I just talked myself into commiting this very minor fix.
Bah now I remember the biggest issue, anyone can give your party bot commands, so guess I won't be commiting just yet.
Remember no matter you do in life to always have a little fun while you are at it
Might have to do a rewrite and try to avoid using a global variable like _whispname. checkEventParty returns the senders name, why not use that to send the response? ie.