wait mail & send whisperer
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
wait mail & send whisperer
Hi i want to ask a strange 2 question
1.Bot sleep until received mail and then go to mailbox
2.For example we have determined the password with somebody..My bot wait received whisper,when he whispered me e.g"moneysend" bot open portable mail box and send money ...How to do that..i didnt find anything for wait received mail or whisper :/ actually whisperer found in auto answer script but wait mail ?I only know that much English sorry for that thanks.good forums
1.Bot sleep until received mail and then go to mailbox
2.For example we have determined the password with somebody..My bot wait received whisper,when he whispered me e.g"moneysend" bot open portable mail box and send money ...How to do that..i didnt find anything for wait received mail or whisper :/ actually whisperer found in auto answer script but wait mail ?I only know that much English sorry for that thanks.good forums
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
Code: Select all
this.Enter = function(self)
local number = UMMSettings:NewMail();
if (number ~= nil) then
if (number > 0) then
GameTooltip:ClearLines();
GameTooltip:ClearAllAnchors();
GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT", 0, 0);
GameTooltip:AddLine("|cff"..UMMColor.Header..UMM_NOTIFY_TOOLTIP_TITLE.."|r");
if (number == 1) then
GameTooltip:AddLine("|cff"..UMMColor.Bright..UMM_NOTIFY_TOOLTIP_NEWMAIL.."|r");
else
GameTooltip:AddLine("|cff"..UMMColor.Bright..string.format(UMM_NOTIFY_TOOLTIP_NEWMAILS, number).."|r");
end
GameTooltip:AddLine("|cff"..UMMColor.Dark..UMM_NOTIFY_TOOLTIP_MOVETIP.."|r");
GameTooltip:Show();
end
end
end;
i found this code in UMM..how to compile for rombot ?
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
nobody knows
Re: wait mail & send whisperer
Try this to receive whisper commands.
If someone whispers to this character "rightpassword sendmoney:200000", it will send 200000 gold to them. Note: untested. Can be used to send other commands that do other actions too.
Will also take mail when new mail is received.
If you want these functions for separate bots then just split the 2 functions into separate repeat loops in separate files.
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
local mypassword = "rightpassword"
EventMonitorStart("WhisperNotify", "CHAT_MSG_WHISPER");
repeat
yrest(1000)
-- Check for whisper
local time, moreToCome, name, msg = EventMonitorCheck("Whisper", "4,1")
if moreToCome ~= nil then
local password, command, value = string.match(msg,"(%w) (%s):(%w)")
if password == mypassword then
if command == "sendmoney" then
UMM_SendMoney(name, tonumber(value))
-- elseif command == "othercommand" then
-- do other action
end
end
end
-- Check for new mail
local newmail = RoMScript("UMMSettings:NewMail()")
if newmail and newmail > 0 then
UMM_TakeMail()
end
until false
</onload>
</waypoints>
Will also take mail when new mail is received.
If you want these functions for separate bots then just split the 2 functions into separate repeat loops in separate files.
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
rock5 wrote:Try this to receive whisper commands.If someone whispers to this character "rightpassword sendmoney:200000", it will send 200000 gold to them. Note: untested. Can be used to send other commands that do other actions too.Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints> <onload> local mypassword = "rightpassword" EventMonitorStart("WhisperNotify", "CHAT_MSG_WHISPER"); repeat yrest(1000) -- Check for whisper local time, moreToCome, name, msg = EventMonitorCheck("Whisper", "4,1") if moreToCome ~= nil then local password, command, value = string.match(msg,"(%w) (%s):(%w)") if password == mypassword then if command == "sendmoney" then UMM_SendMoney(name, tonumber(value)) -- elseif command == "othercommand" then -- do other action end end end -- Check for new mail local newmail = RoMScript("UMMSettings:NewMail()") if newmail and newmail > 0 then UMM_TakeMail() end until false </onload> </waypoints>
Will also take mail when new mail is received.
If you want these functions for separate bots then just split the 2 functions into separate repeat loops in separate files.
Master u are awesome thank you so much ^_^ yes i seperate this function...i change code like
-- Check for new mail
Code: Select all
<onload>
repeat
local newmail = RoMScript("UMMSettings:NewMail()")
if newmail and newmail > 0 then
loadPaths("tier");
else
player:sleep();
end
until false
</onload>
Re: wait mail & send whisperer
You might want to put a yrest in there to lower it's cpu use.
I don't think you want it to go to sleep. It will go to sleep as soon as you start it then wont wake up until you press the resume key.
Edit: Also, for the loaded file to run I think this file has to finish. So, it has to exit this onload. You can do that by adding a "return" just after loading the new file.
I don't think you want it to go to sleep. It will go to sleep as soon as you start it then wont wake up until you press the resume key.
Edit: Also, for the loaded file to run I think this file has to finish. So, it has to exit this onload. You can do that by adding a "return" just after loading the new file.
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
rock5 wrote:You might want to put a yrest in there to lower it's cpu use.
I don't think you want it to go to sleep. It will go to sleep as soon as you start it then wont wake up until you press the resume key.
Edit: Also, for the loaded file to run I think this file has to finish. So, it has to exit this onload. You can do that by adding a "return" just after loading the new file.
Yehho master it works PERFECTLY
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
repeat
local newmail = RoMScript("UMMSettings:NewMail()")
if newmail and newmail > 0 then
yrest(5000);
loadPaths("tier");
return;
else
yrest(500);
end
until false
</onload>
</waypoints>
Re: wait mail & send whisperer
Yep, that should do it.
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
Hi master its me again.Today i am trying to run this code..It doesnt give compile error etc.Find whisperer name on rombot but into infinity loop.didnt send anything.I think i wrote wrong message so i changed password command still didnt send :/ Please make a magic touch on this code and begin to work thanks
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
local mypassword = "1"
EventMonitorStart("WhisperNotify", "CHAT_MSG_WHISPER");
repeat
yrest(1000)
-- Check for whisper
local time, moreToCome, name, msg = EventMonitorCheck("Whisper", "4,1")
if moreToCome ~= nil then
local password, command = string.match(msg,"(%w) (%s)")
if password == "mypassword" then
if command == "2" then
player:target_Object("Mailbox",1000)
UMM_SendMoney(name, 10000)
end
end
end
until false
</onload>
</waypoints>
Re: wait mail & send whisperer
When you start the monitor event you called it "WhisperNotify" but then you check event "Whisper". The names don't match.
The pattern, used to get the command, uses %s which only allows letters for commands. If you want to use numbers as commands use %w which allows letters or numbers or %d that allows only numbers. Also I made a mistake previously, %w or %s only represents 1 character. It needs to be followed by a * to mean any number of characters, eg.
The idea of the variable mypassword is that you can conveniently change your password at the top of the file. You don't compare the password to this variable though, you compare it to a string "mypassword". It's supposed to be
And when you whisper, you should use the value you gave mypassword at the top of the file as the password.
The pattern, used to get the command, uses %s which only allows letters for commands. If you want to use numbers as commands use %w which allows letters or numbers or %d that allows only numbers. Also I made a mistake previously, %w or %s only represents 1 character. It needs to be followed by a * to mean any number of characters, eg.
Code: Select all
local password, command = string.match(msg,"(%w*) (%w*)")
Code: Select all
if password == mypassword then
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
thanks master ill try it ^_^ i am patching now..rock5 wrote:When you start the monitor event you called it "WhisperNotify" but then you check event "Whisper". The names don't match.
The pattern, used to get the command, uses %s which only allows letters for commands. If you want to use numbers as commands use %w which allows letters or numbers or %d that allows only numbers. Also I made a mistake previously, %w or %s only represents 1 character. It needs to be followed by a * to mean any number of characters, eg.The idea of the variable mypassword is that you can conveniently change your password at the top of the file. You don't compare the password to this variable though, you compare it to a string "mypassword". It's supposed to beCode: Select all
local password, command = string.match(msg,"(%w*) (%w*)")
And when you whisper, you should use the value you gave mypassword at the top of the file as the password.Code: Select all
if password == mypassword then
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
Voho finaly understand
change whispernotify line it works.I was trying to work for 3 hours.I asked a lot of question u bored my question so i wanted to understand how to work.change a lot things this 18 line code xD xD xD finally it works thanks master
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
local mypassword = "mypass"
EventMonitorStart("WhisperNotify", "CHAT_MSG_WHISPER");
repeat
yrest(1000)
-- Check for whisper
local time, moreToCome, name, msg = EventMonitorCheck("WhisperNotify", "4,1")
if moreToCome ~= nil then
local password= string.match(msg,"(%w*)")
if password == mypassword then
UMM_SendMoney(name, 10000)
end
end
until false
</onload>
</waypoints>
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
master i have problem..im using a.xml and add loadpaths("b") and b waypoint has repeat function..when goes to b from waypoint a repeat doesnt work just wait..For example i try this function again again loadpofile first time if loop come second time didnt work;
Wait there...(i added loadprofile function to try its work or not)
Code: Select all
<onload>
repeat
local newmail = RoMScript("UMMSettings:NewMail()")
if newmail and newmail > 0 then
yrest(500);
loadPaths("Alisveris");
return;
else
loadProfile()
end
until false
</onload>
Re: wait mail & send whisperer
Is this the repeat that doesn't repeat? I wouldn't use loadProfile() to see if it's working. Use a print message.
You should probably also show me the code that loads this file.
Code: Select all
<onload>
repeat
local newmail = RoMScript("UMMSettings:NewMail()")
yrest(500);
if newmail and newmail > 0 then
loadPaths("Alisveris");
return;
else
print("Still waiting...")
end
until false
</onload>
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
Okey..this code loads Bekleme.xmlrock5 wrote:Is this the repeat that doesn't repeat? I wouldn't use loadProfile() to see if it's working. Use a print message.You should probably also show me the code that loads this file.Code: Select all
<onload> repeat local newmail = RoMScript("UMMSettings:NewMail()") yrest(500); if newmail and newmail > 0 then loadPaths("Alisveris"); return; else print("Still waiting...") end until false </onload>
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onload>
local mypassword = "Sendburo"
EventMonitorStart("WhisperNotify", "CHAT_MSG_WHISPER");
repeat
yrest(1000)
-- Check for whisper
local time, moreToCome, name, msg = EventMonitorCheck("WhisperNotify", "4,1")
if moreToCome ~= nil then
local password= string.match(msg,"(%w*)")
if password == mypassword then
RoMScript("/run OpenMail();")
UMM_SendByNameOrId(name,{"Mana Stone"})
UMM_SendByNameOrId(name,{"Recall Belt"})
UMM_SendByNameOrId(name,{"Random Fusion Stone"})
UMM_SendMoney(name, 20000)
RoMScript("MailFrame:Hide()");
loadPaths("Bekleme");
end
end
until false
</onload>
</waypoints>
Re: wait mail & send whisperer
I don't see an exit to the loop. Try adding a return
That will exit the onload and allow Bekleme to run.
Code: Select all
loadPaths("Bekleme");
return
- 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.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- rido_knight
- Posts: 102
- Joined: Wed May 29, 2013 6:50 am
- Location: Turkey
Re: wait mail & send whisperer
Damn you said before.i forgot.Thanks master.i am going to tryrock5 wrote:I don't see an exit to the loop. Try adding a returnThat will exit the onload and allow Bekleme to run.Code: Select all
loadPaths("Bekleme"); return
EDIT:IT WORKS.THANKS A LOT !!!
rock5 wrote:You might want to put a yrest in there to lower it's cpu use.
I don't think you want it to go to sleep. It will go to sleep as soon as you start it then wont wake up until you press the resume key.
Edit: Also, for the loaded file to run I think this file has to finish. So, it has to exit this onload. You can do that by adding a "return" just after loading the new file.
Who is online
Users browsing this forum: No registered users and 2 guests