SRL Archive - OSR Help

Silk runner


10gez10

2013-02-27 17:03:04

program silkrunning;
var
x, y :Integer;

begin
//This moves and left licks
wait(1400); //1000ms = 1s
Writeln('Finding the silk..')
repeat
//Find the silk stall(next to silver stall)
if findcolor(x, y, 1643026,251,151, MS) then MMouse(x, y, 4, 4, True)

else

begin
//This moves and left licks
wait(1400); //1000ms = 1s
repeat
Writeln('Finding the silk again..')
//Find the silk stall(next to silver stall)
if findcolor(x, y, 2237264,251,151, MS) then MMouse(x, y, 4, 4, True)

else

end;
end;

until(p07_InvFull)
if(p07_InvFull) then findcolor(x, y, 3290937, 308, 174, DB)
end;

else

begin
//This moves and left licks
wait(1400); //1000ms = 1s
writeln('Cant find the silk, logging you out');
Logout; //Logs you out
end;

Simba Crashes after running this script, i cant even compile it


Program exception!
Stacktrace:

Exception class: EAccessViolation
Message: Access violation
$005CEC70
$0042ABBA
$005064E8
$004436C2
$005010A0
$00501678
$0040C37A
$005804CF
$764262FA
$76426D3A
$76430D27
$7643794A
$004252DA
$764262FA
$76426D3A
$764277C4
$7642788A
Simba Version: 992


I personal can code in HTML,Java,C++,VB. I know this has fortan / pascal type style of coding. If i need to use pointers in this please can you say otherwise thanks for looking / trying to help guys.

Neodymium

2013-02-27 17:05:56

You aren't defining procedures or functions. Make sure you define them something like:

function DoSomething(String: Argument): Boolean;
var
someString: String;
begin
WriteLn('Hello there.');
Result := True;
end;

10gez10

2013-02-27 17:08:22

I was asking if i need to use pointers in order to have low memory usage script but never mind, thanks for the link

10gez10

2013-02-27 17:10:15

Ah i see nice

Neodymium

2013-02-27 17:28:46

Sorry about my first reply, I misread your question. :)

What you seem to be doing is implying the whole program runs top-down, but you need to create functions and call them in your main loop instead.
Your last end (in your main loop) should be "end.", not "end;".
I also suggest you use "Wait(RandomRange(high, low))" for your waits, so they are not static (and detectable).
Also, try adding constants to your code (the colors for example) to make it a bit easier to edit (like when that area gets a color update) and more readable.

Your fixed script would look something like:

program silkrunning;
const
SilkColor1 = 12345678;
SilkColor2 = 87654321;

var
AGlobalInt: Integer;

function FindAndThieve(): Boolean;
var
x, y :Integer;
begin
//This moves and left licks
wait(1400); //1000ms = 1s
Writeln('Finding the silk..')
repeat
//Find the silk stall(next to silver stall)
if findcolor(x, y, 1643026,251,151, MS) then
MMouse(x, y, 4, 4, True)
else
begin
Writeln('Finding the silk again..')
//Find the silk stall(next to silver stall)
if findcolor(x, y, 2237264,251,151, MS) then
MMouse(x, y, 4, 4, True)
else
begin
Writeln('Finding the silk again..')
//Find the silk stall(next to silver stall)
if findcolor(x, y, 2237264,251,151, MS) then
MMouse(x, y, 4, 4, True)
else
begin
writeln('Cant find the silk, logging you out');
Logout; //Logs you out
end;
end;
end;
until (p07_InvFull); // Not the real function name I think
if(p07_InvFull) then
findcolor(x, y, 3290937, 308, 174, DB);
end;

// Main loop, change this to what your
begin
while (True) do
begin
FindAndThieve();
Wait(RandomRange(100, 120));
end;
end.
There are probably syntax errors, my if/then/else's may not by formatted correctly, etc.
But you get the idea.

tezzyr

2013-03-01 16:25:14

Pretty sure this is the wrong forum to post 07 Script help. Try moving this thread to "Forum: Old School Help"

cocainenasir

2013-03-01 22:27:13

[Error] (19:45): Unknown identifier 'MS' at line 18
Compiling failed.? that what i got

King

2013-03-01 22:32:50

From: cocainenasir
[Error] (19:45): Unknown identifier 'MS' at line 18
Compiling failed.? that what i got


He hasn't even fixed it yet, slow down there leecher…

live2leech

2013-03-02 12:26:25

Plz also make a bank function!
Thanx !!

10gez10

2013-03-08 01:07:49

when i get the chance ill try fixing this program for now it will be on 'pause' until i have full understanding of this language.

Xeronate

2013-03-08 01:26:23

I don't understand why this is called silkRUNNER