The Dink Network

Reply to problems with move() and wait()

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
November 1st 2010, 04:27 PM
peasantfr.gif
Made a script to let dink move to the left until he runs into something. In order to let dink not keep running against something and not reaching the left of the screen I made a loop to keep checking if dink is still moving. If not I just move him left to his current location overwriting the movement to the entire left of the screen. Here is the code I used, but Dink just keeps running against something instead of stopping his movement.

move(1, 4, 0, 0);

loop:

&dinkx = sp_x(1, -1);
wait(10);
&dinkx2 = sp_x(1, -1);

if (&dinkx != &dinkx2)
{
goto loop;
}

move(1, 4, &dinkx2, 0);


The problem is that the wait(10) for some reason doesn't work. I put say lines in between to see when the script stops and if I put a say-line in front of the wait Dink says it, but if I put it after the wait he doesn't say it. So I am pretty sure it has something to do with the waitline, I just don't understand why it doesn't work.

Does anyone know why it does not work (or another way to make it work)? Thanks in advance.