Page 1 of 1

Event Handling ?

Posted: Sat Oct 03, 2009 4:31 am
by FactorY
Please correct me if i'm wrong, but as far as I know and tested, it is not possible to implement event handling in rombot.
(If there is actually a way, can someone please inform me or write a tutorial on it?)

So my question/suggestion is...
Is it possible to create an empty addon which registers all events, which then goes and triggers interrupt functions within the rombot lua?
eg...

Code: Select all

<Ui>
 <Script file="\MICROMACRO DIRECTORY\ ROMBOT LUA FILE.lua"/>
   <Frame name="micromacro" parent="UIParent" enableMouse="false">
    <Scripts>
      <OnLoad>     
		this:RegisterEvent("VARIABLES_LOADED");
		this:RegisterEvent("SEND_MAIL_SUCCESS");
		this:RegisterEvent("UNIT_PORTRAIT_UPDATE");
      </OnLoad>
      <OnEvent>
		CALL_MICRO_MACRO(event);
      </OnEvent>	  
    </Scripts>
  </Frame>
</Ui> 
Not only will the bot be able to react better to the ingame environment, it will provide us rombot users better access to our own customized bot.

It'll be nice to be able to have like an interrupt function lua file which we can code ourselves during certain triggers.


Edit: NEW IDEA
Is it possible to read the SaveVariables.lua file?
If so, we can always set our event handling addon to change the variables in the file which can then act as interrupts.

Re: Event Handling ?

Posted: Sat Oct 03, 2009 9:24 am
by droppen
we dont want to make rombot so hard to use so that you would have to install addons to your rom. but there is a way to do the event handling. take a look at RoMScript function. writes to memory the macro1 slot, then by using EditMacro rom function rombot writes the return values to macro2 slot, where rombot then reads the return values. you can make an addon to the game, that registers all events and saves the values of the events to macro3 slot or something, then check every second for an update in micromacro for the macro3 slot, then you know what event gave what in micromacro, but it will not be the same as actually calling a function from rombot while the event is being processed