SRL Archive - OSR Help

First Script, Several Errors


Jackrawl

2007-09-09 09:49:18

Ok I know that theres a section for first scripts, I don't want links to it. I wanted to avoid this, but honestly I am stuck.

program World16AirCrafter;                          //By JackLKrawl
{.include srl/srl.scar}
const
Username = 'UserName'; //Fill these out, it's so I can steal
Password = 'Password'; //your account.
Chat = 8388736;//Change this to the trade color to be safe
E = 0; //Change this to the essence color
Z = 0; //This is how many times you want the script to craft airs.
var
x,y: integer;
I: integer;
Spammed: integer;
Essence: integer;
Tradedz: integer;
procedure Spaminate;
begin
Spammed:=Spammed+1;
Random(5);
case random(5) of
0: SendKeys('Open 2k!'+chr(13));
1: SendKeys('Open 2k'+chr(13));
2: SendKeys('Open 2k + Ess!'+chr(13));
3: SendKeys('Open 2k + Ess Back!'+chr(13));
4: SendKeys('Open 2000 + Essence Back!'+chr(13));
end;
end;
Procedure FindChat;
begin
if (GetColor(12,451)=Chat) Then
MoveMouseSmooth(12,451);
Wait(300+random(20));
ClickMouse(12,451, true);
if (not(GetColor(12,451)=Chat)) Then
repeat
Spaminate;
FindChat;
until(GetColor(12,451)=chat);
end;
Procedure EnterGold;
begin
MoveMouseSmooth(577,228);
ClickMouse(577,238,false);
wait(700+random(20));
MoveMouseSmooth(577,318);
ClickMouse(577,318,true);
wait(700+random(20));
Sendkeys('2000');
wait(334+random(986));
Tradedz:=Tradedz+1
end;
Procedure EnterEssence;
Begin
MoveMouseSmooth(619,226); //fix these...
ClickMouse(619,226,false);
Wait(239+random(59));
MoveMouseSmooth(619,318); //fix these...
ClickMouse(619,318,true);
wait(286+random(34));
Sendkeys('25'+chr(13));
Essence:=(Essence+1)*25;
end;
Procedure AcceptorDecline;
begin
If GetColor(331,92)=GetColor(324,290)=E then
MoveMouseSmooth(263,186);
ClickMouse(263,186,true);
Wait(200+random(200));
MoveMouseSmooth(222,311);
ClickMouse(222,311,true);
Wait(200+random(200));
end;
If(not)GetColor(331,92):=E or not(Getcolor(324,290):=E then
MoveMouseSmooth(x,y);
Wait(20+random(300);
ClickMouse(x,y,true);
end;
Procedure CraftZehRunes;
MoveMouseSmooth(x,y);
ClickMouse(x,y,true);
MoveMouseSmooth(x,y);
ClickMouse(x,y,true);
wait(3000+random(5000);
Procedure Proggy;
begin
Writeln('----JACKLKRAWLS---WORLD16---Air---Crafter----')
Writeln('You have spammed '+ inttostr(spammed)+' Innocent People');
Writeln('You have traded '+ inttostr(tradedz)+' Air Runners');
Writeln('You have made '+ inttostr(essence)+' Rune Essence into Airs!!')
end;
begin
repeat
SetupSRL;
ChatAndFindChat;
AntiRandoms;
EnterGold;
EnterEssence;
AcceptOrDecline;
CraftZehRunes;
until(I=Z);
end.

My current error is
Line 64: [Error] (12295:41): Type mismatch in script C:\Program Files\SCAR 3.11\Scripts\JackLKrawl's First Script.scar

Also, I know this does not fulfill the scripting standards, I want it to work before I organize it.

mat_de_b

2007-09-09 10:16:22

First thing to change, is change all the Clickmouses to Mouse(x,y,RandX,RandY,LeftClick); its much more human like…. Same thing for SendText, this is replaced by TypeSend which is also more human like… 3rd If the result of an If clause is morethan one line then you need a begin and end

if(—-)then
begin
—;
—;
end;

Here is your script fixed, hope its what you meant, it compiles without any issues and i fixed it up…



program World16AirCrafter; //By JackLKrawl
{.include srl/srl.scar}
const
Username = 'UserName'; //Fill these out, it's so I can steal
Password = 'Password'; //your account.
Chat = 8388736;//Change this to the trade color to be safe
E = 0; //Change this to the essence color
Z = 0; //This is how many times you want the script to craft airs.
var
x,y: integer;
I: integer;
Spammed: integer;
Essence: integer;
Tradedz: integer;

procedure Spaminate;
begin
Spammed:=Spammed+1;
Random(5);
case random(5) of
0: TypeSend('Open 2k!'+chr(13));
1: TypeSend('Open 2k'+chr(13));
2: TypeSend('Open 2k + Ess!'+chr(13));
3: TypeSend('Open 2k + Ess Back!'+chr(13));
4: TypeSend('Open 2000 + Essence Back!'+chr(13));
end;
end;

Procedure FindChat;
begin
if (GetColor(12,451)=Chat) Then
begin
Mouse(12,451,5,5,true);
end;
if (not(GetColor(12,451)=Chat)) Then
begin
repeat
Spaminate;
FindChat;
until(GetColor(12,451)=chat);
end;
end;

Procedure EnterGold;
begin
Mouse(577,238,5,5,false);
wait(700+random(20));
Mouse(577,318,5,5,true);
wait(700+random(20));
TypeSend('2000');
wait(334+random(986));
Tradedz:=Tradedz+1
end;

Procedure EnterEssence;
Begin
Mouse(619,226,5,5,false);
Wait(239+random(59));
Mouse(619,318,5,5,true);
wait(286+random(34));
TypeSend('25'+chr(13));
Essence:=(Essence+1)*25;
end;
Procedure AcceptorDecline;
begin
if((GetColor(331,92)= E) and (GetColor(324,290) = E)) then
begin
Mouse(263,186,5,5,true);
Wait(200+random(200));
Mouse(222,311,5,5,true);
Wait(200+random(200));
end;
if not((GetColor(331,92)=E) or (Getcolor(324,290)=E)) then
begin
Mouse(x,y,5,5,true); // Where is the x+y from?
end;
end;

Procedure CraftZehRunes;
begin
Mouse(x,y,5,5,true); // X and Y have not been assigned
Mouse(x,y,5,5,true); // ""
wait(3000+random(5000));
end;

Procedure Proggy;
begin
Writeln('----JACKLKRAWLS---WORLD16---Air---Crafter----')
Writeln('You have spammed '+ inttostr(spammed)+' Innocent People');
Writeln('You have traded '+ inttostr(tradedz)+' Air Runners');
Writeln('You have made '+ inttostr(essence)+' Rune Essence into Airs!!')
end;

begin
repeat
SetupSRL;
// ChatAndFindChat; <-- Says it doesnt exist
// AntiRandoms; <-- ""
EnterGold;
EnterEssence;
AcceptOrDecline;
CraftZehRunes;
until(I=Z);
end.

MylesMadness

2007-09-09 10:22:13

Heres a srl version of your script with standers
program World16AirCrafter; //By JackLKrawl
{.include srl/srl.scar}
const
Username = 'UserName'; //Fill these out, it's so I can steal
Password = 'Password'; //your account.
Chat = 8388736; //Change this to the trade color to be safe
E = 0; //Change this to the essence color
Z = 0; //This is how many times you want the script to craft airs.
var
x, y: integer;
I: integer;
Spammed: integer;
Essence: integer;
Tradedz: integer;

procedure Spaminate;
begin
Spammed := Spammed + 1;
Random(5);
case random(5) of
0: TypeSend('Open 2k!');
1: TypeSend('Open 2k' + chr(13));
2: TypeSend('Open 2k + Ess!' + chr(13));
3: TypeSend('Open 2k + Ess Back!' + chr(13));
4: TypeSend('Open 2000 + Essence Back!' + chr(13));
end;
end;

procedure FindChat;
begin
if (GetColor(12, 451) = Chat) then
Mouse(12, 451, 1, 1, true)
if (not (GetColor(12, 451) = Chat)) then
repeat
Spaminate;
FindChat;
until (GetColor(12, 451) = chat);
end;

procedure EnterGold;
begin
Mouse(577, 228, 1, 1, False);
wait(700 + random(20));
Mouse(577, 318, 1, 1, true);
wait(700 + random(20));
typesend('2000');
wait(334 + random(986));
Tradedz := Tradedz + 1
end;

procedure EnterEssence;
begin
Mouse(619, 226, 1, 1, False); //fix these...
Wait(239 + random(59));
Mouse(619, 318, 1, 1, true); //fix these...
wait(286 + random(34));
TypeSend('25');
Essence := (Essence + 1) * 25;
end;

procedure AcceptorDecline;
begin
begin
if GetColor(331, 92) and GetColor(324, 290) = E then
Mouse(263, 186, 1, 1, true);
Wait(200 + random(200));
Mouse(222, 311, 1, 1, true); ;
Wait(200 + random(200));
end;
if not (GetColor(331, 92) := E) or not (Getcolor(324, 290) := E) then
begin
Mouse(x, y, 1, 1, true);
end;

procedure CraftZehRunes;
begin
Mouse(x, y, 1, 1, true);
Mouse(x, y, 1, 1, true);
wait(3000 + random(5000);
end;

procedure Proggy;
begin
Writeln('----JACKLKRAWLS---WORLD16---Air---Crafter----')
Writeln('You have spammed ' + inttostr(spammed) + ' Innocent People');
Writeln('You have traded ' + inttostr(tradedz) + ' Air Runners');
Writeln('You have made ' + inttostr(essence) + ' Rune Essence into Airs!!')
end;

begin
repeat
SetupSRL;
ChatAndFindChat;
AntiRandoms;
EnterGold;
EnterEssence;
AcceptOrDecline;
CraftZehRunes;
until (I = Z);
end.

Jackrawl

2007-09-09 11:06:59

THANKYOU mat, THANKYOU. That MovemouseSmooth(x,y); ClickMouse(x,y); was driving me insane. Thanks for corrections, myles and mat.

Edit:
But I am curious about typesend. Do you still have to enter in chr(13))?
Uhh actually. That's kinda obvious..Ignore ^

Jackrawl

2007-09-09 11:14:57

Oh yeah, and some of those I never added in because I was trying to get most of the script to run first <_<

ShowerThoughts

2007-09-09 11:23:53

dont double post need help look my sig

Jackrawl

2007-09-09 11:44:10

Ok, thanks ^^ I'll pm u if I ever need help

sparkysarmy

2007-09-11 17:36:20

I just dont know how to make scripts or run them so ehhhh

HyperSecret

2007-09-11 18:03:24

type send you dont need +chr(13) b/c typesend presses enter on its own so that is not needed