SRL Archive - Help and Support

help me please


ub3r |<1||3r*1337*

2006-04-16 22:58:55

ok. i have created my al-kharid script with autocolorfinding kind of, and i keep getting this error!
Line 124: [Error] (10900:1): Type mismatch in script C:\Program Files\SCAR 2.03\Scripts\al-kharid silk buyer.scar

here is my script
program silkbuyer;
///////////////////////////////////////////////////////////////////////////
///this will buy silk and bank them, improvements can be PMed to me on
///villavu.com/forums made by: ub3r l<1ll3r
///////////////////////////////////////////////////////////////////////////
{Instructions!!!
1. start at the most northern open bank
2. money in first slot
3. V-bright
4. put your pin in Line 127 if you have one
{.Include SRL\SRL.scar}
{version info:
V1:very unstable[unreleased]
V1.9:a lot more stable with double clicking[unreleased]
V1.95: tested and being released
V2: more stable and with symbol to symbol
V3: fixed up a lot of walking, much more faster
V4:will now log off after 20 loads and has anti-randoms and will do this 6 times until the script will end (100 loads)
V5: now with a progress report
V6: Now standardized (i think)
V7: properly standardized and has Mouse flag detection
V8: now with auto color}

var
N:string;
H,poop,Rx,Ry:Integer;
///////////////SETUP////////////////////////////
Const
User = 'killerkoo4'; ////////your username must go here//////////
Pass = ''; ////////your password must go here//////////
////////Thats all folks!////////////////////////////
////////////////////////////////////////////////////////////////


procedure movesilk;
begin
writeln ('facing north and going to the silk buyer!');
Face(N)
if (findcolortolerance(x,y,994407,643,51,677,70,8)) then
Mouse(x,y,1,1,True)else
writeln('color(s) not found! restart script!');
Flag;
if (findcolortolerance(x,y,598088,653,30,697,54,8)) then
Mouse(x,y,1,1,True)else
Writeln('color(s) not found! restart script!');
Flag;
if (findcolortolerance(x,y,2818305,678,34,719,90,8)) then
Mouse(x,y,1,1,true)else
writeln('color(s) not found! restart script!');
Flag;
if (findcolortolerance(x,y,5505420,597,26,709,118,8)) then
Mouse(x,y,1,1,True)else
writeln('color(s) not found! restart script!');
Flag;
wait(3000)
end;

procedure buy;
begin
poop:=0
repeat
if (findcolortolerance(x,y,12425379,4,4,514,336,8)) then
Mouse(x,y,0,0,True)
Mouse(x,y,0,0,True)
wait(3000)
MMouse(224,444,1,0)
wait(800)
Mouse(224,444,1,0,True)
Mouse(224,444,1,0,True)
wait(1000)
MMouse(270,395,1,0)
wait(800)
Mouse(270,395,1,0,True)
Mouse(270,395,1,0,True)
wait(1000)
MMouse(203,448,1,0)
wait(800)
Mouse(203,448,1,0,True)
Mouse(203,448,1,0,True)
wait(1000)
MMouse(280,446,1,0)
Mouse(280,446,1,0,True)
Mouse(280,446,1,0,True)
wait(2000)
MMouse(238,432,1,0)
Mouse(238,432,1,0,True)
Mouse(238,432,1,0,True)
wait(1000)
MMouse(217,445,1,0)
Mouse(217,445,1,0,True)
wait(1000)
MMouse(290,447,1,0)
Mouse(290,447,1,0,True)
Mouse(290,447,1,0,True)
poop:=poop+1
writeln('we have '+IntToStr(poop)+' silk(s) for this load!')
TalkToRand;
wait(2000)
Until(findcolortolerance(x,y,8625060,703,434,724,454,8))
end;

procedure goback;
begin
Face(N)
wait(1000)
if (findcolortolerance(x,y,598088,596,90,656,129,8)) then
Mouse(x,y,1,1,True)
Flag;
if (findcolortolerance (x,y,2818305,610,80,654,133,8)) then
Mouse(x,y,1,1,True)
Flag;
if (findcolortolerance (x,y,598088,594,90,636,129,8)) then
Mouse(x,y,1,1,True)
Flag;
if (findcolortolerance(x,y,994407,594,84,649,106,8)) then
Mouse(x,y,1,1,True)
Flag;
if (findcolortolerance(x,y,bankcolor,587,59,641,99,8)) then
Mouse(x,y,1,1,True)
Flag;
OpenBank;
if (findcolortolerance(x,y,660059,46,111,97,164,7)) then
InPin(5946)
Deposit2(5,27)
wait(5000)
end;

procedure login;
begin
mouse(450,286,10,10,True)
wait(1000)
sendkeys(User)
sendkeys(chr(13))
sendkeys(Pass)
wait(1000)
mouse(298,323,10,10,True)
wait(5000)
mouse(495,341,10,10,True)
end;

Begin
SetupSRL;
if (findcolortolerance(x,y,5918541,397,288,429,303,6)) then
Login;
repeat
movesilk;
buy;
goback;
H:=H+1
Until(H>=20)
loginplayer;
repeat
H:=0
movesilk;
buy;
goback;
H:=H+1
Until(H>=20)
loginplayer;
repeat
H:=0
movesilk;
buy;
goback;
H:=H+1
Until(H>=20)
loginplayer;
repeat
H:=0
movesilk;
buy;
goback;
H:=H+1
Until(H>=20)
loginplayer;
repeat
H:=0
movesilk;
buy;
goback;
H:=H+1
Until(H>=20)
End.


[Offtopic] am i posting too many threads in the help section?[/Offtopic]

Bebe

2006-04-16 23:03:22

It should be
InPin('5946')

Also, you should just make a "const" for the pin.

and work on your standards :)

phantombmx

2006-04-16 23:22:36

with most of the script you have if-then statements with more than 1 thing for it to do.. do this instead for if-thens with more than 1 thing to do
if(whatever)then
begin
stuff1;
stuff2;
stuff3;
end;

this way it will actually do all those things instead of doing only the first one..

also change your main loop to this and add mcount:integer; to your variables
begin
SetupSRL;
if(findcolortolerance(x,y,5918541,397,288,429,303,6))then
Login;
repeat
H:=0
repeat
movesilk;
buy;
goback;
H:=H+1
until(H>=20)
loginplayer;
mcount:= mcount+1
until(mcount>=5)
end.

this is simpified to make it shorter..
also, standards standards standards :p had to say it 3 times

and no you can never have too many questions

WhiteShadow

2006-04-16 23:43:17

program SilkBuyer;
///////////////////////////////////////////////////////////////////////////
///This will buy silk and bank them, improvements can be PMed to me on //
///villavu.com/forums made by: ub3r l<1ll3r //
///////////////////////////////////////////////////////////////////////////
{Instructions
1. Start at the most Northern Open Bank
2. Money in first slot
3. V-bright
4. Put your pin in Line 127 if you have one
{.include SRL\SRL.Scar}
{Version info:
V1:very unstable[unreleased]
V1.9:a lot more stable with double clicking[unreleased]
V1.95: tested and being released
V2: more stable and with symbol to symbol
V3: fixed up a lot of walking, much more faster
V4:will now log off after 20 loads and has anti-randoms and will do this 6 times until the script will end (100 loads)
V5: now with a progress report
V6: Now standardized (i think)
V7: properly standardized and has Mouse flag detection
V8: now with auto color}

var
H, Poop : Integer;
/////////////////SETUP////////////////////////////
Const
User = 'killerkoo4';
Pass = '';
Pin1 ='5946';
//////////////////////////////////////////////////



procedure MoveSilk;
begin
Writeln('Facing North and going to the silk buyer!');
Face('N');
if(FindColorTolerance(x, y, 994407, 643, 51, 677, 70, 8))then
Mouse(x, y, 1, 1, true)
else
Writeln('Color(s) not found! restart script!');
Flag;
if(FindColorTolerance(x, y, 598088, 653, 30, 697, 54, 8))then
Mouse(x, y, 1, 1, true)
else
Writeln('Color(s) not found! restart script!');
Flag;
if(FindColorTolerance(x, y, 2818305, 678, 34, 719, 90, 8))then
Mouse(x, y, 1, 1, true)
else
Writeln('Color(s) not found! restart script!');
Flag;
if(FindColorTolerance(x, y, 5505420, 597, 26, 709, 118, 8))then
Mouse(x, y, 1, 1, true)
else
Writeln('Color(s) not found! restart script!');
Flag;
Wait(3000);
end;

procedure Buy;
begin
Poop:=0
repeat
if(FindColorTolerance(x, y, 12425379, 4, 4, 514, 336, 8))then
Mouse(x, y, 0, 0, true);
Mouse(x, y, 0, 0, true);
Wait(3000);
MMouse(224, 444, 1, 0);
Wait(800);
Mouse(224, 444, 1, 0, true);
Mouse(224, 444, 1, 0, true);
Wait(1000);
MMouse(270, 395, 1, 0);
Wait(800);
Mouse(270, 395, 1, 0, true);
Mouse(270, 395, 1, 0, true);
Wait(1000);
MMouse(203, 448, 1, 0);
Wait(800);
Mouse(203, 448, 1, 0, true);
Mouse(203, 448, 1, 0, true);
Wait(1000);
MMouse(280, 446, 1, 0);
Mouse(280, 446, 1, 0, true);
Mouse(280, 446, 1, 0, true);
Wait(2000);
MMouse(238, 432, 1, 0);
Mouse(238, 432, 1, 0, true);
Mouse(238, 432, 1, 0, true);
Wait(1000);
MMouse(217, 445, 1, 0);
Mouse(217, 445, 1, 0, true);
Wait(1000);
MMouse(290, 447, 1, 0);
Mouse(290, 447, 1, 0, true);
Mouse(290, 447, 1, 0, true);
Poop:= Poop + 1
Writeln('We have '+IntToStr(Poop)+' silk(s) for this load!');
TalkToRand;
Wait(2000);
until(FindColorTolerance(x, y, 8625060, 703, 434, 724, 454, 8))
end;

procedure GoBack;
begin
Face('N');
Wait(1000);
if(FindColorTolerance(x, y, 598088, 596, 90, 656, 129, 8))then
Mouse(x, y, 1, 1, true);
Flag;
if(FindColorTolerance(x, y, 2818305, 610, 80, 654, 133, 8))then
Mouse(x, y, 1, 1, true);
Flag;
if(FindColorTolerance(x, y, 598088, 594, 90, 636, 129, 8))then
Mouse(x, y, 1, 1, true);
Flag;
if(FindColorTolerance(x, y, 994407, 594, 84, 649, 106, 8))then
Mouse(x, y, 1, 1, true);
Flag;
if(FindColorTolerance(x, y, BankColor, 587, 59, 641, 99, 8))then
Mouse(x, y, 1, 1, true);
Flag;
if(FindColorTolerance(x, y, 660059, 46, 111, 97, 164, 7))then
InPin(Pin1);
Deposit2(5, 27);
Wait(5000);
end;

procedure LogIn;
begin
Mouse(450, 286, 10, 10, true);
Wait(1000);
SendKeys(User);
SendKeys(Chr(13));
SendKeys(Pass);
Wait(1000);
Mouse(298, 323, 10, 10, true);
Wait(5000);
Mouse(495, 341, 10, 10, true);
end;

begin
SetupSRL;
if(FindColorTolerance(x, y, 5918541, 397, 288, 429, 303 ,6))then
Login;
repeat
MoveSilk;
Buy;
GoBack;
H:= H + 1
until(H >= 20)
LogInPlayer;
repeat
H:=0
MoveSilk;
Buy;
GoBack;
H:= H + 1
until(H >= 20)
LogInPlayer;
repeat
H:=0
MoveSilk;
Buy;
GoBack;
H:= H + 1
until(H >= 20)
LoginPlayer;
repeat
H:=0
MoveSilk;
Buy;
GoBack;
H:= H + 1
until(H >= 20)
LogInPlayer;
repeat
H:=0
MoveSilk;
Buy;
GoBack;
H:= H + 1
until(H >= 20)
end.

Yes like Bebemycat2 says it should be a string. Problem solved.

Changes I made:
1. Tried to standerize it, unfortunately I use the if()then differently than you so, I'm not quite sure about the spaces on that.
2. Made Const Pin1 (A String) And changed InPin(5946) to: InPin(Pin1);
3. Changed Face(N) to Face('N') No need to declare N as a string like that.
4. Removed the Rx, and Ry

I would give you suggestions but, your script was mainly based on autocolors and coords so I can't give you much feedback.

~WhiteShad0w

P.S I like how your trying.

ub3r |<1||3r*1337*

2006-04-17 09:15:25

thanks, ok, now that i'm getting my al-kharid silk buyer almost flawless 'Almost'. I want to know how to switch players lol, havent learned that yet cuz i was tied up with learning the basics. and now i'm making a falador auto miner with auto colors. Remind me how to set up auto colors again( i got the GetFaladorBasiccolors; on)

EDIT: and I thank everyone for always helping me when i need it

Sdcit

2006-04-17 14:05:56

DO NOT do something that advanced yet. to swithc:

nextplayer(true)= you are safe nad knwo where you are

nextplayer(false)= lost, dead, random, etc.

For autocolors go through the whole include in misc to know which procedures.


create a var like for example

var
a:Integer;


then do

a:=function here


because it reutrns a integer