translate of addon to bot

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

translate of addon to bot

#1 Post by Ajoir » Fri Sep 16, 2011 7:11 pm

Code: Select all

local timeInvited = nil;
local timeDeclineDelay = 2 + math.random(7);
function declineInvite_OnUpdate()
	if( timeInvited ~= nil and os.difftime(os.time(), timeInvited) > timeDeclineDelay ) then
This is a part of an addon. I want translate it to bot, but "timeInvited" doesn't work. Which it's the code what i must write to work as userfunction? I dont know if i explain it right....

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#2 Post by lisa » Fri Sep 16, 2011 8:00 pm

So you just want bot to autodecline invites?

If you want the addon to be somehow called from the bot I would need a lot more code then what you posted. Somewhere else in the addon it will be giving timeInvited a value of not nil otherwise it would never work.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

Re: translate of addon to bot

#3 Post by Ajoir » Fri Sep 16, 2011 8:47 pm

lisa wrote:So you just want bot to autodecline invites?

If you want the addon to be somehow called from the bot I would need a lot more code then what you posted. Somewhere else in the addon it will be giving timeInvited a value of not nil otherwise it would never work.
yes, i want a autodecline invite in trade, duel and party.
i think must be something like that:

Code: Select all

if  [b](this its the code that i unknow) [/b] then
    RoMScript("StaticPopup_OnClick(StaticPopup1, 2);")
     printf("decline for party/duel/trade ");
     soundPlay(soundresource);
end
Somewhere else in the addon it will be giving timeInvited a value of not nil otherwise it would never work.
I don't know if I understand you. I have the addon "d303fix". I send you my original addon. it works fine, but i prefer work how userfuncion
Attachments
declineInvite.lua
(2.29 KiB) Downloaded 112 times

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#4 Post by lisa » Fri Sep 16, 2011 10:10 pm

If the addon works fine then I would stick with it.

Trouble is with doing the same thing with the bot is we would need to create a monitoring of those events which would put more load on the bot usage.
The game itself already monitors such events and makes it much easier to use an addon to deal with declining.

If there wasn't an addon then you could probably search memory for the pop and what causes it to monitor it without constantly sending macros to in game but since the addon already exists I would just use it.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

Re: translate of addon to bot

#5 Post by Ajoir » Fri Sep 16, 2011 11:44 pm

lisa wrote:If the addon works fine then I would stick with it.

Trouble is with doing the same thing with the bot is we would need to create a monitoring of those events which would put more load on the bot usage.
The game itself already monitors such events and makes it much easier to use an addon to deal with declining.

If there wasn't an addon then you could probably search memory for the pop and what causes it to monitor it without constantly sending macros to in game but since the addon already exists I would just use it.

Well... i'll prove, I must add the decline trade... and something little change. thanks for your help.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#6 Post by lisa » Sat Sep 17, 2011 12:31 am

Of course you can always just change the addon to do what you want =)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

Re: translate of addon to bot

#7 Post by Ajoir » Tue Nov 01, 2011 9:02 pm

Hi again :P

I tried the addon... and dont like it. The sound does not work , It need on the game´s sound and sometime overlapping. I like try make it in bot. Could you help me, please?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#8 Post by lisa » Tue Nov 01, 2011 9:34 pm

I can try but I would need to know exactly what you want to do and what was the addons name?
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

Re: translate of addon to bot

#9 Post by Ajoir » Thu Nov 03, 2011 7:49 am

i want to make a function what activate it when someone will give me trade, duel and party. I want the same operation of the addon.
When someone give me:
- In a time oscilating between 3 and 10 second autodecline invite.
- give me an alarm sound.

I dont know make to the function detect the event. In the addon, used:

Code: Select all

 if( event == "PARTY_INVITE_REQUEST" ) then
		
 if( event == "TRADE_REQUEST" ) then
In the function i think i may use "eventmonitorcheck", but i dont know how to do it. The rest of the function, i think i can do it.

i send you the addon. The name is declineinvite


P.D.: I don't speak english too good, if someting it´s confusing, say me and I try to explain better.

Thank you in advance.
Attachments
declineInvite.lua
(2.28 KiB) Downloaded 104 times

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#10 Post by lisa » Thu Nov 03, 2011 9:32 am

So you like the addon and what it does but you also want it to make sound and have a randomized delay before declining?

I still think the best thing is to just alter the addon itself.
Anything else you want the addon to do because those 2 things are very easy to implement.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

Re: translate of addon to bot

#11 Post by Ajoir » Thu Nov 03, 2011 12:18 pm

Yeah, its more easy, but the sound it´s the problem for me. An addon and the game share them the sound. there are any form to make the sound's addon work free how a bot?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#12 Post by lisa » Thu Nov 03, 2011 9:17 pm

Ahh so what you really want is to play a sound independant of the game, I'll do some testing.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#13 Post by lisa » Thu Nov 03, 2011 10:37 pm

Ok give this a test run and see what you think.

save the alarm.wav to
runes of magic/Interface/AddOns/declineInvite/Sound/alarm.wav

What I did was increase the volume of the alarm.wav and then when you get an invite it detects the master volume level and adjusts the interface volume so you hear the alarm sound at a nice volume, it then sets interface volume back to where it was previously.

So it still does what declineinvite always did but now you have a nice volume alarm and then interface volume goes back to where it was.

I couldn't find the actual addon on rom.curse anymore so I couldn't test or do much more then this.
If you post entire addon I could do more =)

Hmm it changes volume back before the sound has finished playing, need to work out how to add in a time delay and I have always had issue with that in addons =(
Attachments
alarm high volume.zip
save the alarm.wav to
runes of magic/Interface/AddOns/declineInvite/Sound/alarm.wav
(9.05 KiB) Downloaded 111 times
declineInvite.lua
added in usage for higher volume sound file.
(3.29 KiB) Downloaded 98 times
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

Re: translate of addon to bot

#14 Post by Ajoir » Fri Nov 04, 2011 7:40 am

A new function... really it's imaginative. Don't worry, this it's enough for me. I want make some changes, but I think i can do it myself. Thank you really much.

Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

Re: translate of addon to bot

#15 Post by Ajoir » Fri Nov 04, 2011 4:30 pm

Anyway ... the perfect solution would be that the addon will run the sound file from any external program: Windows Media or similar. I send you the full addon; If you can do that and get it, great ... if you can don´t, nothing happens, already you've helped me enough.
Attachments
declineInvite.rar
(10.39 KiB) Downloaded 95 times

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#16 Post by lisa » Sat Nov 05, 2011 12:08 am

If you still really want to do it via bot this is what you are after.

Code: Select all

function checkinvite()
	-- invite popup static address is 0x9EB8B8 4.0.4.2456
	if memoryReadInt(getProc(), 0x9EB8B8) == 1 then
		yrest(2000)
		RoMScript("StaticPopup_OnClick(StaticPopup1, 2)")
		if playalarm then
			playalarm()
		end
	end
end
Put this in your onload, WP or profile

Code: Select all

unregisterTimer("Checkforpopup");
registerTimer("Checkforpopup", secondsToTimer(5), checkinvite);
It will look for the popup every 5 seconds, if it detects a popup it will cancel it 2 seconds after it detects it, so in total can be random time of 2-7 seconds.
If you get the userfunction I made for playing an alarm it will play that sound.
http://www.solarstrike.net/phpBB3/viewt ... =27&t=3129

--=== Note ===--
This function has the address in it, so anytime there is a patch the address will need updating.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

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

Re: translate of addon to bot

#17 Post by rock5 » Sat Nov 05, 2011 7:05 am

I'd say it's not a good idea to put a yrest in a timer event. You don't know when it's going to be triggered. Instead, I'd remember the time and do it later. That way the bot can continue doing what it's doing while waiting to decline the invite. Some thing like.

Code: Select all

function checkinvite()
	-- invite popup static address is 0x9EB8B8 4.0.4.2456
	if remembertime then
		if os.time() - remembertime > 5 then
			RoMScript("StaticPopup_OnClick(StaticPopup1, 2)")
			remembertime = nil
		end
	elseif memoryReadInt(getProc(), 0x9EB8B8) == 1 then
		if playalarm then
			playalarm()
		end
		remembertime = os.time()
	end
end
  • 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
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: translate of addon to bot

#18 Post by lisa » Sat Nov 05, 2011 7:57 am

Good point, I would probably do 2 seconds as opposed to 5 though. with 5 second intervals in the event timer, it may have already been 4 seconds since someone tried to invite you.

Code: Select all

 if os.time() - remembertime > 2 then
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Ajoir
Posts: 32
Joined: Mon May 30, 2011 1:29 pm

Re: translate of addon to bot

#19 Post by Ajoir » Sat Nov 05, 2011 9:01 am

whou, you did it!!!. Thankyou very much for your work. Now I gonna test it. When finish I tell you.

Post Reply

Who is online

Users browsing this forum: No registered users and 113 guests