Hi Simba community,
I watched YoJoJo's TuT and his gold fish script worked well, but it got out of control really fast and I couldn't stop with CTRL+S or using F2 or FN+ALT+F4. I had to log out of my PC to crash the plug-in! So many goldfish were saved it was scary...
So here's the thing. I want to save a set amount of goldfish and then make the script stop once it has saved that amount. I've been trying for days now reading all about loops and repeats - I even messaged YoHoJo, but it's the weekend and was hoping if I just put out there I might get a reply from someone!![]()
I tried the "For" loop, but all it seems to do is type 0 0 0 0 0 0 in the debug box. I know there's something I'm doing wrong - please help me!!
Current script:
program new;
var
XFish: Integer;
//http://www.i-am-bored.com/bored_link.cfm?link_id=10574
procedure StartGame;
begin
MoveMouse(350, 160)
ClickMouse(350, 160, 1);
Wait(1000);
end;
procedure SaveGoldfish;
var
x, y:Integer;
begin
if FindColorSpiralTolerance(x, y, 1471228, 16, 33, 266, 235, 20) or
FindColorSpiralTolerance(x, y, 1204732, 16, 33, 266, 235, 20) or
FindColorSpiralTolerance(x, y, 549886, 16, 33, 266, 235, 20) or
FindColorSpiralTolerance(x, y, 869629, 16, 33, 266, 235, 20) Then
begin
MoveMouse(x, y);
HoldMouse(x, y, 1);
MoveMouse(306, 103);
Wait(2000);
ReleaseMouse (306, 103, 1);
Inc(XFish);
Writeln('We have saved a Goldfish ' + IntToStr(XFish) + ' times');
end;
end;
begin
StartGame;
repeat
SaveGoldfish;
until(XFish >= 4);
end.
>>>>>>>>>>>>>>>>>>
debug box:
Compiled successfully in 15 ms.
We have saved a Goldfish 1 times
We have saved a Goldfish 2 times
We have saved a Goldfish 3 times
We have saved a Goldfish 4 times
Successfully executed.
>>>>>>>>>>>>>>>>>>
I thought that creating an integer 'XFish' it would go through that loop everytime and increase by 1 until it got to 4.
Why isn't that? What am I doing wrong? It seems to recognise the timer of 2s I set, but I want it to increase by 1 every time I run the whole procedure and not count from 1 to 4 in 2s intervals and then stop.
Please help me- right now it feels like I hit a solid brick wall. Loops and repeats looked simple in the guides so it's so frustrating to see that I can't even make it save X amounts of fish
... I don't want it to go on forever!
Got my fingers crossed for a reply~


,
Reply With Quote










