ID:1124615
 
(See the best response by DarkCampainger.)
Problem description:

I'm attempting to create my own 'input' boxes, and I want to use them all over as a replacement to the default input() proc, however.. I know input() does a special thing that I'm not too sure how to go about.

It pauses the current proc until input() returns.

So far what I've thought of is calling a proc like..
gui_input(parameters)


Then starting a loop which checks if the window is still visible on the screen (whether they've closed it, hit enter which returns the input, or whatever) and then 'unpauses' if not, returning the value which was retrieved.

What do you guys think?
I think having a set variable would be less CPU intensive than checking for the window over and over.

mob/var/tmp/is_paused = 0


Then just loop that, set it when the window has been opened, just a Close button on the window then you can unpause and hide the window in code.
In response to A.T.H.K
I wouldn't check every tick to avoid being really CPU intensive, like you say.

I'd rather not define multiple variables for mobs like that though, since people can have up multiple input windows at once, that single variable isn't an extremely accurate gauge.

It would work, it's just I wouldn't be able to count on accurate timing when people try to open more than one of them at a time, which is something I'd like to avoid if possible.

Do you think it'd be really intensive to run it every second?
Really I am not to totally sure, compared to a variable which can be either true or false and checked simply with ! , I would say it'll be more intensive but more than likely not noticeable ?

Try it out for me :)
Best response
Check out Garthor's GetClick library. He uses a helper object that sleep()s to block the procedure. Then, when a selection is made, he deletes the helper, instantly ending the sleep() and allowing the original procedure to continue.
In response to DarkCampainger
That's definitely an interesting library. Seems pretty simple too, I've already read it all and understood it.

This however works solely with clicks, so it wouldn't really coincide with setting the command of an input on the custom input window to something, and pressing enter to submit the input instead of clicking the 'Enter', or 'Ok' buttons it shows.

It's almost a full fix, I'm just not sure how to go about the command ordeal.
The idea is to have a helper that makes the proc sleep. After submitting an input, delete the helper to stop the proc from sleeping.
In response to Jemai1
Oh, I get it now.. If an object is deleted, all ongoing procs are terminated. So I could just make it sleep infinitely until it's deleted, and that would do the job too.

Wow, yeah, this works, thanks a ton.
Yea. You got that right.