wait mail & send whisperer

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

wait mail & send whisperer

#1 Post by rido_knight » Fri Oct 25, 2013 8:38 am

Hi i want to ask a strange 2 question :D

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 :D...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 :D thanks.good forums

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#2 Post by rido_knight » Sat Oct 26, 2013 3:46 am

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 ?

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#3 Post by rido_knight » Sun Oct 27, 2013 4:52 am

nobody knows :(

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: wait mail & send whisperer

#4 Post by rock5 » Sun Oct 27, 2013 6:29 am

Try this to receive whisper commands.

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>
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.
  • 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

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#5 Post by rido_knight » Mon Oct 28, 2013 4:36 am

rock5 wrote:Try this to receive whisper commands.

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>
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.

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>
but into an infinite loop :D i ll try later password mail this code so important

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: wait mail & send whisperer

#6 Post by rock5 » Mon Oct 28, 2013 5:03 am

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.
  • 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

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#7 Post by rido_knight » Mon Oct 28, 2013 6:37 am

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 :lol: :lol: :lol: :lol: :lol: :lol: :lol:

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>

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: wait mail & send whisperer

#8 Post by rock5 » Mon Oct 28, 2013 6:53 am

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

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#9 Post by rido_knight » Tue Oct 29, 2013 8:08 am

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 :mrgreen: :mrgreen: :mrgreen: 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>

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: wait mail & send whisperer

#10 Post by rock5 » Tue Oct 29, 2013 8:49 am

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.

Code: Select all

         local password, command = string.match(msg,"(%w*) (%w*)")
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

Code: Select all

         if password == mypassword then
And when you whisper, you should use the value you gave mypassword at the top of the file as the password.
  • 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

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#11 Post by rido_knight » Wed Oct 30, 2013 10:17 am

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.

Code: Select all

         local password, command = string.match(msg,"(%w*) (%w*)")
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

Code: Select all

         if password == mypassword then
And when you whisper, you should use the value you gave mypassword at the top of the file as the password.
thanks master ill try it ^_^ i am patching now..

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#12 Post by rido_knight » Wed Oct 30, 2013 2:06 pm

Voho :mrgreen: finaly understand :D

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>
change whispernotify line it works.I was trying to work for 3 hours.I asked a lot of question :D 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 :D

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#13 Post by rido_knight » Sat Nov 30, 2013 4:10 pm

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;

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>
      
Wait there...(i added loadprofile function to try its work or not)
Image

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: wait mail & send whisperer

#14 Post by rock5 » Sat Nov 30, 2013 10:08 pm

Is this the repeat that doesn't repeat? I wouldn't use loadProfile() to see if it's working. Use a print message.

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>
You should probably also show me the code that loads this 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

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#15 Post by rido_knight » Sun Dec 01, 2013 5:33 am

rock5 wrote:Is this the repeat that doesn't repeat? I wouldn't use loadProfile() to see if it's working. Use a print message.

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>
You should probably also show me the code that loads this file.
Okey..this code loads Bekleme.xml

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>

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: wait mail & send whisperer

#16 Post by rock5 » Sun Dec 01, 2013 5:41 am

I don't see an exit to the loop. Try adding a return

Code: Select all

loadPaths("Bekleme");
return
That will exit the onload and allow Bekleme to run.
  • 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

User avatar
rido_knight
Posts: 102
Joined: Wed May 29, 2013 6:50 am
Location: Turkey

Re: wait mail & send whisperer

#17 Post by rido_knight » Sun Dec 01, 2013 6:05 am

rock5 wrote:I don't see an exit to the loop. Try adding a return

Code: Select all

loadPaths("Bekleme");
return
That will exit the onload and allow Bekleme to run.
Damn you said before.i forgot.Thanks master.i am going to try


EDIT:IT WORKS.THANKS A LOT !!! :mrgreen: :mrgreen: :mrgreen: :mrgreen:
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.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 17 guests