Log in

View Full Version : Error



Draven
05-19-2007, 02:23 PM
Line 239: [Error] (14657:5): Unknown identifier 'PolyGlotTalk' in script C:\Program Files\SCAR 3.06\includes\SRL\SRL\extended\xAntiBan.scar


{ //-------------------------------------------------------------\\
|| INSTRUCTIONS ||
||-------------------------------------------------------------||
|| ||
|| 1. Fill in the setup below. ||
|| 2. Add your players in the DECLARE PLAYERS Lines 38-65. ||
|| 3. Drag Crosshair into RS window. ||
|| 4. No more forms for now so just hit play. ||
|| EX: By the way, the axe head finder might work! ||
||-------------------------------------------------------------||
|| INSTRUCTIONS ||
\\-------------------------------------------------------------//
}

{.include SRL\SRL.SCAR}
{.include SRL\SRL\extended\xAntiBan.scar}

Var
AxeHeadColor1, AxeHeadColor2, LoadNumber : Integer;
LogDTM, BrokenAxeDTM, AxeHandleDTM, RegularAxeDTM, AxeHeadMask : Integer;
StartXP, EndXP, TotalXP, TotalLogs : Integer;

Const
//---------------------------------------------------------------------------
// SETUP
//-----------------------------------------------------------------------------
AmmountOfLoads = 5; //Ammount of loads you want to chop before switching players.
TheTreeName = 'Tree'; //Just guess.
Boxy = True; // Use Box Solver?
Sandy = True; // Use Sandwich Solver?
//-----------------------------------------------------------------------------

//--------------------//
Treecolor = 4353420; //Probobly should change this...
//--------------------//


//->Declare Players<-//
Procedure DeclarePlayers;
begin
Status('Loading Players')

HowManyPlayers := 1;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := ''; // 2-4 letters of username
Players[0].Active := True;

Players[1].Name := 'UserName';
Players[1].Pass := 'Password';
Players[1].Nick := 'Nickname'; // 2-4 letters of username
Players[1].Active := True;

Players[2].Name := 'UserName';
Players[2].Pass := 'Password';
Players[2].Nick := 'Nickname'; // 2-4 letters of username
Players[2].Active := True;

Players[3].Name := 'UserName';
Players[3].Pass := 'Password';
Players[3].Nick := 'Nickname'; // 2-4 letters of username
Players[3].Active := True;
end;


//->Load Dtm's<-//
Procedure LoadDTMs;

begin
Status('Loading DTM''s')

LogDTM := DTMFromString('78DA632C666260E0646440067921460CFF8 13' +
'448F43F103066314179C880118904D2354035FF19F0AB2905 AA11' +
'22604E23500D0F0135C94035DCF8D50000507909F5');

BrokenAxeDTM := DTMFromString('78DA633CCAC4C090C1C8800C9A127919FE0 36' +
'990E87F2060BC0C54938CAA06220B2381F445A09A04026A8E 01D5' +
'C41050B31FA8A698809AB384CD0100CBBD0D20');


AxeHandleDTM := DTMFromString('78DA637CCFC4C0E0C6C8800CCA227819FE0 36' +
'990E87F2060FC06546389AA06220B2381F473A09A00026ADE 00D5' +
'F81350F316A8C685809A97403541F8D50000D0090D3C');

RegularAxeDTM := DTMFromString('78DA637461626060676440060DF1BC0CFF8 13' +
'448F43F10300601D5FC6740038C482490F604AAF94D408D13 500D' +
'2B237E35F640358204D4F813618E1F50CD1F02EE0906AA61C 26F0' +
'E0099720B7E');

AxeHeadMask := BitmapFromString(12, 8, 'z78DA3330200CDC3080018900' +
'972E62CC24D55E4C9594BB993C13C8733FB5DCE3860310AF9 2185' +
'B008E3078E5');
end;


//->Setup<-//
Procedure MySetupScript;
Begin
Status('Set-Up')
SetupSRL;
DeclarePlayers;
LoadDTMs;
UseSandwichSolver := Sandy;
UseBoxSolver := Boxy;
Begin
If (Not(LoggedIn)) then
Begin
Status('Logging In')
Loginplayer;
end;
end;
end;


//->Anti Randoms<-//
Procedure TheAntiRandoms;
Begin
Status('Random Check')
FindNormalRandoms;
wait(10)
FindTalk;
wait(10)
if (FindFight) then
begin
RunAwayDirection('E');
Wait(8500 + random(3500));
RunBack;
end;
Wait(10);
FindTalk;
end;


//->Anti Ban<-//
Var
WCLEVEL, DONTBAN : Integer;

Procedure TheAntiBan;
begin
WCLEVEL := GetSkillLevel('WoodCutting')
TheAntiRandoms;
Status('Preforming Antiban')
if ( not ( LoggedIn )) then Exit;
DONTBAN:= 1 + Random(140)
case DONTBAN of
1: RandomRClickEvery(2 + Random(10));
2: HoverSkill('woodcutting', false);
3: HoverSkill('random', false);
4: DoEmote(1 + Random(20));
5: BoredEvery(9 + Random (21));
6: PickUpMouse;
7: LeaveScreenEvery(10 + Random(5));
8: RotateEvery(20 + Random(5));
9: MMouse(MSX1,MSX2,10,10)
10: MakeCompass('N')
11: MakeCompass('S')
12: GameTab(1+random(7))
13: HighestAngle;
14: TypeSend('Lol my wc lvl is ' +IntToStr (WClevel) + '.')
15: TypeSend('Wc lvl ' +IntToStr (WClevel) + '! Sweet!')
16: TypeSend('Grr, my wc lvl is only ' +IntToStr (WClevel) + '')
17: GetSkillLevel('WoodCutting')
18: GameTab(1+Random(7))
19: MakeCompass('W')
20: MakeCompass('E')
21: TypeSend('I''m lvl ' +IntToStr (WClevel) + ', but I want ' +IntToStr (WClevel + 3 + Random(8)) + '')
22: TypeSend('' +IntToStr (WClevel) + ' woodcuting.../')
23: TypeSend('I can''t wait till im lvl ' +IntToStr (WClevel + 4 + Random(7)) + '')
24: TypeSend('Hmm... im only lvl ' +IntToStr (WClevel) + ' woodcutting... i should go for ' +IntToStr (WClevel + 6 + Random(8))+'')
25: TypeSend('yay... lvl ' +IntToStr (WClevel) + 'wc... still...')
26: TypeSend('cool! only ' + IntToStr (10+random(8)) + 'k xp till lvl ' +IntToStr (WClevel + 1 + random(4)) + ' wc')
27: TypeSend('WC lvl ' +IntToStr (WClevel) + '')
28: TypeSend('hmph... only ' +IntToStr (WClevel) + '')
end;
TheAntiRandoms;
end;


//->Get Axe Colors<-//
Procedure GetAxeColors;
Begin
GameTab(4)
Wait( 400 + random (100) )
AxeHeadColor1 := GetColor( 589, 218 )
AxeHeadColor2 := GetColor( 590, 220 )
ClearDebug;
WriteLn('Axe Colors are ' + IntToStr(Axeheadcolor1) + ' and ' + IntToStr(AxeHeadColor2) + '')
end;


//->Ent Checker<-//
Var
EX, EY : integer;
FX, FY : integer;
Procedure EntChecker;
Begin
Status('Checking For Ent')
Flag;
If (FindObjMultiText(EX, EY, TheTreeName, TheTreeName, TheTreeName, Treecolor, 4)) then
Begin
MMouse(Ex, EY, 0, 0)
If FindColorTolerance( FX, FY, 55769, 85, 15, 115, 15, 20) then
Begin
Status('Ent Found');
MouseFindFlag(648,83,5,5);
Wait(15000+Random(5000));
end;
end;
end;


//->Check for Broken Axe<-//
Var
BX, BY, NX, NY : integer;

Procedure IsAxeBroken;
Begin
Status('Checking for broken axe')
GameTab(4)
Wait(400 + Random (100))
If (Not(FindDTM(BrokenAxeDTM, BX, BY, MIX1, MIY1, MIX2, MIY2 ))) then
Begin
Status('Axe Not Broken')
Exit;
end;
Begin
If (FindDTM(BrokenAxeDTM, BX, BY, MIX1, MIY1, MIX2, MIY2 )) and
(Not(FindDTM(RegularAxeDTM, NX, NY, MIX1, MIY1, MIX2, MIY2))) then
Begin
Status('Broke an Axe')
NextPlayer(False)
end;
end;
end;


//->Axe Head Finder<-//
Var
AX, AY, SX, SY, HX, HY : Integer;

Procedure TheFindAxe;
Begin
GameTab(4)
If (FindDTM(AxeHandleDTM, AX, AY, MIX1, MIY1, MIX2, MIY2 )) Then
Begin
Status('Looking For Axe')
If FindObjArea(SX, SY, 'head', MSX1, MSY1, MSX2, MSY2, AxeHeadColor1, 3, True) or
FindObjArea(SX, SY, 'head', MSX1, MSY1, MSX2, MSY2, AxeHeadColor2, 3, True) then
Begin
Mouse(SX, SY, 3, 3, False)
ChooseOption(x, y, 'Take')
Wait(300 + Random (100))
GameTab(4)
If FindBitmap(AxeHeadMask, HX, HY) then
Begin
Mouse(HX, HY, 3, 3, True)
Wait(100 + Random(100))
Mouse(AX, AY, 3, 3, True)
end;
end;
end;
end;


//->Start Chopping<-//
Var
TX, TY : Integer;

Procedure StartChopping;
Begin
Repeat
Begin
IsAxeBroken;
Status('Looking For Oak')
If (InvFull) then
Begin
Exit;
end;
EntChecker;
If (FindObjMultiText(TX, TY, TheTreeName, TheTreeName, TheTreeName, Treecolor, 4)) then
Begin
Mouse(TX, TY, 3, 3, True)
Wait( 100 + Random (200) )
TheAntiRandoms;
Wait(10)
TheAntiBan;
Wait(10)
EntChecker;
Wait(10)
TheFindAxe;
Wait(4000+Random(1000))
end;
end;
Until (InvFull)
end;


//->Start Dropping<-//
Var
LX, LY, DroppedLogsCount : Integer;

Procedure StartDropping;
Begin
If (InvFull) then
Begin
GameTab(4)
DroppedLogsCount := CountItemDtm(LogDTM) + 6
Repeat
GameTab(4)
If (FindDTM(LogDTM, LX, LY, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(LX, LY, 8, 8, false)
ChooseOption(x,y,'Drop')
TheAntiRandoms;
wait(400+random(100))
end;
Until (Not(FindDTM(LogDTM, LX, LY, MIX1, MIY1, MIX2, MIY2)))
LoadNumber := LoadNumber + 1
end;
end;

//->Progress Report<-//
Procedure ReportIt;
Begin
SRLRandomsReport;
WriteLn('')
WriteLn('<------------------------------------------------>')
WriteLn(' | PROGRESS REPORT |')
WriteLn('<------------------------------------------------>')
WriteLn(' Script Time: ' + (TimeRunning) + '')
WriteLn(' Logs Chopped: ' + IntToStr (TotalLogs) + '')
WriteLn(' XP Gained: ' + IntToStr (EndXP - StartXP + TotalXP) + '')
WriteLn('<------------------------------------------------>')
WriteLn(' | PROGRESS REPORT |')
WriteLn('<------------------------------------------------>')
end;

//->Main Stuff<-//
begin
wait(1200)
MySetupScript;
HighestAngle;
Repeat
GetAxeColors;
StartXP := GetXp('Woodcutting')
Repeat
StartChopping;
If ( Not (LoggedIn) ) Then NextPlayer (False)
StartDropping;
EndXP := GetXp('Woodcutting')
TotalLogs:= TotalLogs + DroppedLogsCount
ReportIt;
If ( Not (LoggedIn) ) Then NextPlayer (False)
Until (LoadNumber + Random (5) = AmmountOfLoads)
LogOut;
NextPlayer(True);
HighestAngle;
If ( Not (LoggedIn) ) Then NextPlayer (False)
Until False;
end.

Pentti
05-19-2007, 02:29 PM
You must change includes to this:
{.include SRL\SRL\extended\xAntiBan.scar}
{.include SRL\SRL.SCAR}

But then you get "Line 28: [Error] (31:6): Unknown identifier 'TimeFromMark'", because AntiBan uses TimeFromMark procedure which SRL.scar includes, and XantiBan.scar is included first so it wont regonize it.

Lol, a bug in SRL, seems like you cant use antiban stuff. :D

EDIT: I checked it and you need to add {.include SRL\SRL\extended\xAutoTalk.scar} before xantiban.scar

So add this into it:
{.include SRL\SRL.SCAR}
{.include SRL\SRL\extended\xAutoTalk.scar}
{.include SRL\SRL\extended\xAntiBan.scar}

Draven
05-19-2007, 02:33 PM
Update: I ran the script with the edits you told me to make.. still another error. :(

Line 267: [Error] (283:1): Unknown identifier 'TypeSend' in script C:\Program Files\SCAR 3.06\includes\SRL\SRL\extended\xAutoTalk.scar

Pentti
05-19-2007, 02:42 PM
Lol it gave me an error: "uknown identifier 'FindObjArea'"
Then I added {.include SRL\SRL\extended\xObject.scar}

Well, then I tried to run with it, then it gave another error (In SRL).
This is too stupid. I dont even use SRL 3.7, I have SRL 3.6 it works fine for me. :D

Draven
05-19-2007, 02:44 PM
Is SRL 3.6 available?
I guess when I installed SCAR it auto-updated to SRL 3.7...

Yup, same error as yours.
Line 252: [Error] (15663:4): Unknown identifier 'FindObjArea' in script C:\Program Files\SCAR 3.06\Scripts\Any Tree Power Chopper.scar

Pentti
05-19-2007, 02:54 PM
Go to http://www.freddy1990.com and download SCAR 2.03.
SRL 3.6: http://www.villavu.com/forum/showthread.php?t=10331?t=11583 (Post #2)

Exctract SRL 3.6 to SCAR's main folder.

Draven
05-19-2007, 03:03 PM
Meh..

Line 174: [Hint] (195:43): Variable 'NEWLINE' never used in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Globals.scar
[Runtime Error] : Out Of Range in line 49 in script C:\Program Files\SCAR 2.03\Scripts\Any Tree Power Chopper 4.scar

Pentti
05-19-2007, 03:04 PM
Meh..

Line 174: [Hint] (195:43): Variable 'NEWLINE' never used in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Globals.scar
its ok, its just a hint, not an error. :D

Draven
05-19-2007, 03:10 PM
[Runtime Error] : Out Of Range in line 49 in script C:\Program Files\SCAR 2.03\Scripts\Any Tree Power Chopper 4.scar

Procedure DeclarePlayers;
begin
Status('Loading Players')

HowManyPlayers := 1;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 0;

Players[0].Name := 'i typed name here';
Players[0].Pass := 'and pw herer';
Players[0].Nick := 'put the first 2 letters of the name'; // 2-4 letters of username
Players[0].Active := True;

Players[1].Name := 'Username'; << leave these like this? (LINE 49 IS HERE)
Players[1].Pass := 'Password'; << leave these like this?
Players[1].Nick := 'Nickname'; // 2-4 letters of username
Players[1].Active := False; <<< i set these to false is that correct?

Players[2].Name := 'Username';
Players[2].Pass := 'Password';
Players[2].Nick := 'Nickname'; // 2-4 letters of username
Players[2].Active := False;

Players[3].Name := 'Username';
Players[3].Pass := 'Password';
Players[3].Nick := 'Nickname'; // 2-4 letters of username
Players[3].Active := False;
end;

Pentti
05-19-2007, 03:13 PM
HowManyPlayers := 4;

Draven
05-19-2007, 03:35 PM
Ok it finally works but when I run it.. it only completes the login procedure and doesn't click on the welcome screen to exit it and if I manually exit the welcome screen it doesn't even begin the script itself, my character just sits there.