View Single Post
04/11/14, 11:23 PM   #4
Durstie
Join Date: Apr 2014
Posts: 3
Smile Global Variables

So, if the global variables get set during particular events (like a search being sent and waiting for a response), then I should be able to echo the variable value to the chat box to watch its value change in my script as it is running too fast. This should tell me the different states of the variable (nil, 0, 1, true, false, etc.). I wasn't sure if I could check the globals directly since it crashed my game the last time I tried. That might be because I was doing it wrong. Like I said, I've only been at LUA scripting for less than a week now. :$

Thank you Iyanga and Xrystal for the tips. I checked the events, and there is no "Waiting for trading house response" event. I've read over the events and stared at that list for a couple hours while trying to think of a way to code 2 even handlers, one to send the search and one to handle the results; but like I said there is no event triggered when the results are sent back to the client (unless I am misunderstanding).

I'm going back to tinker and think about your suggestions. I'll keep you posted, and thank you for the direction.

Edit 1: I like the idea of setting the result of the search function to a variable and then checking the variable, but according to the wiki that function does not return anything. Not a true, false, integer, etc. Is there an inherent/undocumented return value that is expected that I don't know about?

Edit 2: Xrystal, it appears I was mistaken. I must have been overwhelmed with the amount of data at hand, because I found the search response event, and now have an event handler that echos "Got response" every time a search result is posted! Thanks again, I'm very new to this, but can't believe I overlooked this simple item.... :$ Pressing on!

Thank you,


Durstie

Last edited by Durstie : 04/12/14 at 12:22 AM. Reason: Adding more comments and updates.
  Reply With Quote