using MM to pass information to addon?
using MM to pass information to addon?
hey, anther weird question
still in the process of making a combined advanced autofighter addon, going ok in the direction of an alpha stage, and i found a dead end:
is there a possibility to run MM in the background, and "ask it" from my addon to pass me for ex the distance of my target, so that my addon can use it for calculations?
thx
still in the process of making a combined advanced autofighter addon, going ok in the direction of an alpha stage, and i found a dead end:
is there a possibility to run MM in the background, and "ask it" from my addon to pass me for ex the distance of my target, so that my addon can use it for calculations?
thx
Re: using MM to pass information to addon?
well I don't think you could get the addon to directly tell MM but you could have MM monitoring for info, after all it monitors 1000's of things from the game all the time, mostly done via memory now though but RoMScripts can get info from the in game functions which would include an addon.
small example is my madman addon I have for dod first boss.
MM uses this
the addon has this
So the addon is changing the value of madman.Time and MM is monitoring it's value.
You can also do it the other way of course but this is just the example I had off hand.
Another example is the loginxml, the addon and scripts work together to be able to do what they do, worth a browse.
small example is my madman addon I have for dod first boss.
MM uses this
Code: Select all
if RoMScript("madman.Time") >= 1 then
player:clearTarget();
printf("Running\n")
yrest(4000)
end
Code: Select all
function mm_OnUpdate(frame, elapsedTime)
if madman.Time >= 1 then
madman.Time = madman.Time + elapsedTime
end
if madman.Time >= 5 and mm_once == false then
MoveForwardStop();
mm_once = true
end
if madman.Time >= 7 and mm_once == true then
madman.Time = 0
mm_once = false
end
end
You can also do it the other way of course but this is just the example I had off hand.
Another example is the loginxml, the addon and scripts work together to be able to do what they do, worth a browse.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: using MM to pass information to addon?
The difference there is the bot script is getting info from the game. Having the addon ask for information from the bot would be more difficult, mainly because the addon can't just wait for a response but has to use the onupdate event, which makes things a bit more complex.
- 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
Re: using MM to pass information to addon?
I am guessing he wants a UI with target information, so you could have nil info until MM makes the info = something else.
So on screen you would see
Dist = --
and when MM updates the info it says
Dist = 128
As for getting addon to tell MM to update, it would depend what you are doing. If you just want target info you could set MM to monitor having a target and when it has a target to constantly send certain info to the addon variables that will update on the screen UI as it is received, there would be a small delay but it would work.
So on screen you would see
Dist = --
and when MM updates the info it says
Dist = 128
As for getting addon to tell MM to update, it would depend what you are doing. If you just want target info you could set MM to monitor having a target and when it has a target to constantly send certain info to the addon variables that will update on the screen UI as it is received, there would be a small delay but it would 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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: using MM to pass information to addon?
ty for the ides, guys
i have one also (thinking hard to find a solution)
i run MM in the background, with a WP that toggles spamming of a button. now instead of the button it would spam a macro 10 times a second, the macro of my addon.
since my addon cannot get distance info from the game, i was thinking about passing it from MM:
and then, take distance as an argument and process it in my addon to act accordingly
seems a good idea?
i have one also (thinking hard to find a solution)
i run MM in the background, with a WP that toggles spamming of a button. now instead of the button it would spam a macro 10 times a second, the macro of my addon.
since my addon cannot get distance info from the game, i was thinking about passing it from MM:
Code: Select all
RoMScript("MyBattleFunction(" .. distance .. ")")
seems a good idea?
Re: using MM to pass information to addon?
it wouldn't be hard.
Just do a check for target and is attackable, do distance check and spamm the macro, not sure you will get to 10 times a second though.
Just do a check for target and is attackable, do distance check and spamm the macro, not sure you will get to 10 times a second though.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: using MM to pass information to addon?
haha yeah, i saw that the more advanced the bot is, the slower the reaction time is. that is why i want to combine it with an addon, and use MM only for info that can be obtained exclusively from memory
Re: using MM to pass information to addon?
You could even create your own version of bot.lua as such with just the memory monitoring, so it doesn't look for mobs or anything else.
I think setting it to travel would be the same but it could be fun if you have the time lol
I think setting it to travel would be the same but it could be fun if you have the time lol
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: using MM to pass information to addon?
You could have the bot just continuously getting the target value like lisa said but write it to a macro. Then have the addon spam your attack function using the current value in the macro. That way if the addon is faster than the bots updates, it can spam the attack many times per each bot update.
But are we talking about manual play but with bot/addon attack or are you trying to use your addon for attack while using the bot for normal navigation?
But are we talking about manual play but with bot/addon attack or are you trying to use your addon for attack while using the bot for normal navigation?
- 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
Re: using MM to pass information to addon?
oh sorry i was talking about manual playing
botting some materials is fine as it is bc i don't need fery fast dps there.
what do you mean by
sorry if the question is stupid, but i do not fully understand
botting some materials is fine as it is bc i don't need fery fast dps there.
what do you mean by
?but write it to a macro. Then have the addon spam your attack function using the current value in the macro.
sorry if the question is stupid, but i do not fully understand
Re: using MM to pass information to addon?
You could create a bot function or waypoint onload code that keeps checking if the player has a target. If so, the easy solution would be to change a variable in game, eg
Then just have the addon use that value when it's there.
But to get faster speed than using a RoMScript you could write to a macro instead, eg.Then you can have the addon read the macro using GetMacroInfo function. Of course you would have to make sure they use the same macro.
Code: Select all
RoMScript("} targetdistance = "..distance.." a={")
But to get faster speed than using a RoMScript you could write to a macro instead, eg.
Code: Select all
writeToMacro(macroNum, distance)
- 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
Re: using MM to pass information to addon?
wow, rock, very good idea
i did not know i can pass variables like that. this opens up a whole dimension of possibilities ( i am a lua script kiddie lol, php is my domain)
ty for the info, i try to create smtg good with this
i did not know i can pass variables like that. this opens up a whole dimension of possibilities ( i am a lua script kiddie lol, php is my domain)
ty for the info, i try to create smtg good with this
Re: using MM to pass information to addon?
is there a way for the bot to check if a rogue is behind the target?
Re: using MM to pass information to addon?
yes but would involve some complicated math stuff, you could just check if a rogue is within X distance of a mob easily though.
As for the behind stuff check my userfunction I made a little while back
http://www.solarstrike.net/phpBB3/viewt ... =27&t=3713
It has all sorts of complicated math stuff in it for those calculations.
As for the behind stuff check my userfunction I made a little while back
http://www.solarstrike.net/phpBB3/viewt ... =27&t=3713
It has all sorts of complicated math stuff in it for those calculations.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: using MM to pass information to addon?
thx lisa, i will implement it
Re: using MM to pass information to addon?
so i have managed it.
thx u all.
how can i precisely say the frequency the bot is updating my info? can i print it out somehow how many fractions of a seconds have passed after a code cycle? to find out the time resolution the bot can handle, and maybe to optimize some code, and take out executed functions i don't need.
thx u all.
how can i precisely say the frequency the bot is updating my info? can i print it out somehow how many fractions of a seconds have passed after a code cycle? to find out the time resolution the bot can handle, and maybe to optimize some code, and take out executed functions i don't need.
Re: using MM to pass information to addon?
to test function speeds generally you would set a variable to the current time, run a loop of # doing the function and then print the difference between the time varible and current time.
So that will tell you how long it took you to do 500 of the function.
If it took you 20 seconds then you are doing a function 20/500 seconds.
Code: Select all
local _time = os.time()
for i = 1,500 do
RoMScript("SendSystemChat('lol')")
end
print(os.difftime(os.time(), _time)
If it took you 20 seconds then you are doing a function 20/500 seconds.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: using MM to pass information to addon?
thanks lisa, not exactly what i wanted, but it was useful, and helps, and sometimes my english sux at explaining
Re: using MM to pass information to addon?
If you are after the number of times a code is done you just need a simple var = var + 1
just print var when you want to know the number of times the code was done.
Combination of that and the time difference should get what you are after.
just print var when you want to know the number of times the code was done.
Combination of that and the time difference should get what you are after.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: using MM to pass information to addon?
yes, this is what i wanted
thank you!
thank you!
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests