[S]paz
2008-02-23 07:04:29
Ok, every script i make (which works), when i add smart to it i get the same access violation error everytime.
here is my latest script. But i can work out why smart doesnt work on it.
but i always end up with
since its a runtime error it tells me the script is fine (it compiles and runs without smart) but as soon as i add smart to it i get a runtime error immediately after.
Any ideas??
~Spaz
here is my latest script. But i can work out why smart doesnt work on it.
{ #/#/#/#/#/#/#/#/#/#/# PLAN #/#//#/#/#/#/#/#/#/#
1. Hometele
2. Go to Bob person
3. Get Axe via false click, claim
4. walkpath to Tree
5. DDTM of Trees to get on it
6. Cut Tree till no more space
7. Gen store, sell
8. "repeat" 30 min
9. Nextplayer
10. repeat
#//#/#//#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#}
program LETS;
{.Include SRL/SRL/Misc/Smart.scar} // Here i added smart, and in my SRL.scar i did markus' fix type thing
{.Include SRL/SRL.scar}
{.Include SRL/SRL/Skill/Magic.scar)
{.include SRL/SRL/skill/WoodCutting.scar}
{.Include SRL/SRL/Misc/Path.scar}
var
x, y, Sold, FindTreeDDTM, LumbyDDTM, AfterSellDDTM, start, Got : Integer;
MainSeller, OtherSeller, NormLog, Active, AntiRandom, proc, TotSold : Integer;
Went : Boolean;
const
TimesLook = 20; // How many times to look for Gen Store man
TreeColor0 = 3244660;
TreeColor1 = 4285284;
TreeColor2 = 2120529;
yourSRLID = '';
yourSRLPW = '';
procedure DeclarePlayers;
begin
NumberOfPlayers(6);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active := True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active := False;
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Active := False;
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active := False;
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Active := False;
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Active := False;
end;
Procedure FindTreeDDTMLoad;
var
FindTreeMP: TDTMPointDef;
FindTreeSP: Array [0..4] of TDTMPointDef;
FindTreeDDTMSkel: TDTM;
Color : Integer;
begin
Color := FindWaterColor;
FindTreeMP.x := 792;
FindTreeMP.y := 257;
FindTreeMP.AreaSize := 0;
FindTreeMP.AreaShape := 0;
FindTreeMP.Color := 1930100;
FindTreeMP.Tolerance := 0;
FindTreeSP[0].x := 792;
FindTreeSP[0].y := 257;
FindTreeSP[0].AreaSize := 0;
FindTreeSP[0].AreaShape := 0;
FindTreeSP[0].Color := 1930100;
FindTreeSP[0].Tolerance := 0;
FindTreeSP[1].x := 795;
FindTreeSP[1].y := 253;
FindTreeSP[1].AreaSize := 0;
FindTreeSP[1].AreaShape := 0;
FindTreeSP[1].Color := 2443874;
FindTreeSP[1].Tolerance := 0;
FindTreeSP[2].x := 824;
FindTreeSP[2].y := 255;
FindTreeSP[2].AreaSize := 0;
FindTreeSP[2].AreaShape := 0;
FindTreeSP[2].Color := Color;
FindTreeSP[2].Tolerance := 0;
FindTreeSP[3].x := 767;
FindTreeSP[3].y := 263;
FindTreeSP[3].AreaSize := 0;
FindTreeSP[3].AreaShape := 0;
FindTreeSP[3].Color := 2443874;
FindTreeSP[3].Tolerance := 0;
FindTreeSP[4].x := 795;
FindTreeSP[4].y := 246;
FindTreeSP[4].AreaSize := 0;
FindTreeSP[4].AreaShape := 0;
FindTreeSP[4].Color := 2649151;
FindTreeSP[4].Tolerance := 0;
FindTreeDDTMSkel.MainPoint := FindTreeMP;
FindTreeDDTMSkel.SubPoints := FindTreeSP;
FindTreeDDTM := AddDTM(FindTreeDDTMSkel);
end;
Procedure InLumbyDDTM;
var
LumbyDDTMMP: TDTMPointDef;
LumbyDDTMSP: Array [0..4] of TDTMPointDef;
LumbyDDTMSkel: TDTM;
Color : Integer;
begin
Color := FindRoadColor;
LumbyDDTMMP.x := 754;
LumbyDDTMMP.y := 258;
LumbyDDTMMP.AreaSize := 1;
LumbyDDTMMP.AreaShape := 0;
LumbyDDTMMP.Color := 6316135;
LumbyDDTMMP.Tolerance := 225;
LumbyDDTMSP[0].x := 754;
LumbyDDTMSP[0].y := 258;
LumbyDDTMSP[0].AreaSize := 1;
LumbyDDTMSP[0].AreaShape := 0;
LumbyDDTMSP[0].Color := 6316135;
LumbyDDTMSP[0].Tolerance := 225;
LumbyDDTMSP[1].x := 754;
LumbyDDTMSP[1].y := 227;
LumbyDDTMSP[1].AreaSize := 0;
LumbyDDTMSP[1].AreaShape := 0;
LumbyDDTMSP[1].Color := 8474450;
LumbyDDTMSP[1].Tolerance := 0;
LumbyDDTMSP[2].x := 755;
LumbyDDTMSP[2].y := 286;
LumbyDDTMSP[2].AreaSize := 0;
LumbyDDTMSP[2].AreaShape := 0;
LumbyDDTMSP[2].Color := 8474450;
LumbyDDTMSP[2].Tolerance := 0;
LumbyDDTMSP[3].x := 738;
LumbyDDTMSP[3].y := 258;
LumbyDDTMSP[3].AreaSize := 0;
LumbyDDTMSP[3].AreaShape := 0;
LumbyDDTMSP[3].Color := Color;
LumbyDDTMSP[3].Tolerance := 0;
LumbyDDTMSP[4].x := 768;
LumbyDDTMSP[4].y := 257;
LumbyDDTMSP[4].AreaSize := 0;
LumbyDDTMSP[4].AreaShape := 0;
LumbyDDTMSP[4].Color := Color;
LumbyDDTMSP[4].Tolerance := 0;
LumbyDDTMSkel.MainPoint := LumbyDDTMMP;
LumbyDDTMSkel.SubPoints := LumbyDDTMSP;
LumbyDDTM := AddDTM(LumbyDDTMSkel);
end;
Procedure AfterSeller;
var
AfterSellMP: TDTMPointDef;
AfterSellSP: Array [0..3] of TDTMPointDef;
AfterSellSkel: TDTM;
begin
AfterSellMP.x := 796;
AfterSellMP.y := 249;
AfterSellMP.AreaSize := 1;
AfterSellMP.AreaShape := 0;
AfterSellMP.Color := 6118243;
AfterSellMP.Tolerance := 225;
AfterSellSP[0].x := 796;
AfterSellSP[0].y := 249;
AfterSellSP[0].AreaSize := 1;
AfterSellSP[0].AreaShape := 0;
AfterSellSP[0].Color := 6118243;
AfterSellSP[0].Tolerance := 225;
AfterSellSP[1].x := 784;
AfterSellSP[1].y := 253;
AfterSellSP[1].AreaSize := 0;
AfterSellSP[1].AreaShape := 0;
AfterSellSP[1].Color := 6118243;
AfterSellSP[1].Tolerance := 0;
AfterSellSP[2].x := 784;
AfterSellSP[2].y := 232;
AfterSellSP[2].AreaSize := 0;
AfterSellSP[2].AreaShape := 0;
AfterSellSP[2].Color := 6118243;
AfterSellSP[2].Tolerance := 0;
AfterSellSP[3].x := 807;
AfterSellSP[3].y := 266;
AfterSellSP[3].AreaSize := 0;
AfterSellSP[3].AreaShape := 0;
AfterSellSP[3].Color := 6118243;
AfterSellSP[3].Tolerance := 0;
AfterSellSkel.MainPoint := AfterSellMP;
AfterSellSkel.SubPoints := AfterSellSP;
AfterSellDDTM := AddDTM(AfterSellSkel);
end;
Procedure LoadDDTM;
begin
FindTreeDDTMLoad;
InLumbyDDTM;
AfterSeller;
MainSeller := DTMFromString('78DA639CCDC0C060CBC8800C1A32C3C0344C9' +
'4711290504155D35A538DAAA6174898A2AAC9F7D64055B30C534D82A' +
'312AA9A3540C21F554DBC9F03AA9A59402200554D5376048A1A0036D' +
'70BB5');
OtherSeller := DTMFromString('78DA635464646070026224D0941D01A661A28' +
'C2035B2A86A6C6C3451D5080259C6A86AFA138D51D598015966A86A2' +
'26CE431CD094655B3BC211E558D39901582AA66666938AA1A23202B1' +
'5554D52A013AA1A494C35E87E070094760C57');
NormLog := DTMFromString('78DA631467666098C0C8800C9A536DC0344C9' +
'4910FA8A613550D4C16AE4601A8A68D801A15A09A9904D480EC9A855' +
'F0D0012000490');
end;
Procedure Proggie;
var
I : Integer;
begin
cleardebug;
for i:=0 to howmanyplayers-1 do
begin
writeln(+players[i].name+' ~ '+left(booltostr(players[i].active),1)+' ~ Was '+IntToStr(start)+' WC now '+IntToStr(Proc)+' WC ~ Sold '+inttostr(Sold)+' loads');
end;
writeln('/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*');
writeln('*/ Willowz Basher by Spaztaz666');
writeln('*/ Chopping For '+TimeRunning);
writeln('*/ Done '+inttostr(TotSold)+' loads in total');
writeln('*/ Got '+inttostr(Got)+' Axes from tutor');
writeln('/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*');
ReportVars[1] := TotSold
SRLRandomsReport;
end;
Procedure WaitForThisChar;
begin
If Not (LoggedIn) then Exit;
begin
Logout;
Writeln('Waiting 10 + rand 3 min then NextPlayer(True)');
Wait(600000 + Random(300000));
NextPlayer(True);
Sold := 0;
end;
end;
function Teleneeded : boolean;
begin
If not DTMRotated(LumbyDDTM, x, y, MMX1, MMY1, MMX2, MMY2) or
Not DTMRotated(FindTreeDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
Result := True;
end;
Procedure Hometele;
begin
if not (loggedin) then exit;
If (TeleNeeded) then
begin
GameTab(7);
Mouse(566+random(10),232+random(13),0,0,true);
FtWait(90);
if (FindBlackChatMessage('ou need to wait another'))then
begin
WaitForThisChar;
end;
end;
end;
Function DetermineBobVisit : Boolean;
var
Axe : Integer;
begin
Axe := DTMFromString('78DA633CC9C4C0D0C9C8800C7CAC94C1344C9' +
'4F120504D0BAA1A982C5CCD4EA09AB904D49C02AAE923A0E60C504D2' +
'B0135FB816ABAF0AB01005CCB08AC');
begin
Gametab(4)
If Not FindDTM(Axe, x, y, MIX1, MIY1, MIX2, MIY2) then
Result := True;
end;
FreeDTM(Axe);
end;
Procedure ToBobRoad;
begin
MouseSpeed := 16;
RoadColor := FindRoadColor;
Path[0].Mainpoint.x:=682;
Path[0].Mainpoint.y:=117;
Path[0].Subpoints[0].x:=682;
Path[0].Subpoints[0].y:=107;
Path[0].Subpoints[1].x:=688;
Path[0].Subpoints[1].y:=114;
Path[0].Subpoints[2].x:=683;
Path[0].Subpoints[2].y:=123;
Path[1].Mainpoint.x:=624;
Path[1].Mainpoint.y:=102;
Path[1].Subpoints[0].x:=627;
Path[1].Subpoints[0].y:=107;
Path[1].Subpoints[1].x:=627;
Path[1].Subpoints[1].y:=101;
Writeln(BoolToStr(FindPath(0, False)));
end;
Procedure GetAxe;
var
I : Integer;
begin
ToBobRoad;
WalkPath(0);
WalkPath(1);
For I := 0 To 8 Do
begin
If not WalkPath(I) then
begin
HomeTele;
end;
end;
end;
Procedure Bobbing;
var
Bob, BronzeAxe, T, I : Integer;
begin
Bob := DTMFromString('78DA630C6164608802622080900C0CD56AF20' +
'C0F91F88C414096318C070136369A287A181D802C6F5435207350D47' +
'802591B50D584D8A8A3AA8905B2A6A2AA7197E04455930464B9A3AAC' +
'95090425103005B84092F');
BronzeAxe := DTMFromString('78DA63FCC7C0C020CAC8800C7CAC94C1344C9' +
'4F12B90104455039385AB790B24B408A8F90C24C409A86164244E8D0' +
'4AA9A0C315E143500456A05B8');
begin
If FindSymbol(x, y, 'Axe Shop') then
Mouse(x, y, 1, 1, true);
Flag;
begin
If DTMRotated(Bob, x, y, mSx1, mSy1, mSx2, mSy2) then
Mouse(x, y, 1, 1, False);
ChooseOption('rade');
Got := Got + 1
If Not DTMRotated(Bob, x, y, mSx1, mSy1, mSx2, mSy2) then
begin
If FindSymbol(x, y, 'Axe Shop') then
Mouse(x, y, 1, 1, true);
For I := 0 To 20 Do
begin
If FindColorTolerance(x, y, 1778028, MSX1, MSY1, MSX2, MSY2, T) then
MMouse(x, y, 1, 1);
If IsUpText('alk-to') then
Mouse(x, y, 1, 1, False);
end;
end;
begin
If FindDTM(BronzeAxe, x, y, mSx1, mSy1, mSx2, mSy2) then
Mouse(x, y, 1, 1, False);
ChooseOption('uy 1');
If Not FindDTM(BronzeAxe, x, y, mSx1, mSy1, mSx2, mSy2) then
begin
If FindSymbol(x, y, 'Axe Shop') then
Mouse(x, y, 1, 1, true);
Flag;
end;
Gametab(4);
if FindNpcChatText('do not have enough') then
Writeln('Please have money or axe next time')
Players[CurrentPlayer].Loc := 'PleaseHaveAxe';
NextPlayer(False);
//countcoin function
end;
end;
end;
Went := True;
end;
Procedure ToTrees;
var
I : Integer;
begin
If not (Went) and (loggedin) then
begin
MouseSpeed := 16;
RoadColor := FindRoadColor;
Path[0].Mainpoint.x:=689;
Path[0].Mainpoint.y:=81;
Path[0].Subpoints[0].x:=686;
Path[0].Subpoints[0].y:=85;
Path[0].Subpoints[1].x:=686;
Path[0].Subpoints[1].y:=68;
Path[0].Subpoints[2].x:=686;
Path[0].Subpoints[2].y:=80;
Path[1].Mainpoint.x:=594;
Path[1].Mainpoint.y:=24;
Path[1].Subpoints[0].x:=589;
Path[1].Subpoints[0].y:=23;
Path[1].Subpoints[1].x:=596;
Path[1].Subpoints[1].y:=26;
Path[1].Subpoints[2].x:=594;
Path[1].Subpoints[2].y:=25;
Path[2].Mainpoint.x:=588;
Path[2].Mainpoint.y:=38;
Path[2].Subpoints[0].x:=586;
Path[2].Subpoints[0].y:=35;
Path[2].Subpoints[1].x:=583;
Path[2].Subpoints[1].y:=37;
Path[2].Subpoints[2].x:=594;
Path[2].Subpoints[2].y:=47;
Writeln(BoolToStr(FindPath(0, False)));
begin
WalkPath(0);
WalkPath(1);
WalkPath(2);
For I := 0 To 2 Do
begin
If not WalkPath(I) then
begin
HomeTele;
end;
end;
end;
end;
end;
Procedure Trees2;
var
I : Integer;
begin
If (went) then
begin
MouseSpeed := 16;
RoadColor := FindRoadColor;
Path[0].Mainpoint.x:=629;
Path[0].Mainpoint.y:=30;
Path[0].Subpoints[0].x:=638;
Path[0].Subpoints[0].y:=21;
Path[0].Subpoints[1].x:=615;
Path[0].Subpoints[1].y:=27;
Path[0].Subpoints[2].x:=634;
Path[0].Subpoints[2].y:=39;
Path[1].Mainpoint.x:=609;
Path[1].Mainpoint.y:=35;
Path[1].Subpoints[0].x:=624;
Path[1].Subpoints[0].y:=49;
Path[1].Subpoints[1].x:=610;
Path[1].Subpoints[1].y:=35;
Path[1].Subpoints[2].x:=589;
Path[1].Subpoints[2].y:=23;
Path[2].Mainpoint.x:=592;
Path[2].Mainpoint.y:=66;
Path[2].Subpoints[0].x:=606;
Path[2].Subpoints[0].y:=71;
Path[2].Subpoints[1].x:=581;
Path[2].Subpoints[1].y:=58;
Path[2].Subpoints[2].x:=592;
Path[2].Subpoints[2].y:=65;
Path[3].Mainpoint.x:=600;
Path[3].Mainpoint.y:=54;
Path[3].Subpoints[0].x:=598;
Path[3].Subpoints[0].y:=40;
Path[3].Subpoints[1].x:=598;
Path[3].Subpoints[1].y:=37;
Path[3].Subpoints[2].x:=608;
Path[3].Subpoints[2].y:=56;
Writeln(BoolToStr(FindPath(0, False)));
begin
WalkPath(0);
WalkPath(1);
WalkPath(2);
WalkPath(3);
For I := 0 To 3 Do
begin
If not WalkPath(I) then
begin
HomeTele;
end;
end;
end;
end;
end;
Procedure Sell;
var
Look : Integer;
begin
If Not(LoggedIn) then Exit;
begin
If FindDTM(NormLog,x ,y ,MIX1, MIY1, MIX2, MIY2) then
repeat
begin
If DTMRotated(MainSeller, x, y, mSx1, mSy1, mSx2, mSy2) or DTMRotated(OtherSeller, x, y, mSx1, mSy1, mSx2, mSy2) then
Mouse(x, y, 1, 1, False);
ChooseOption('rade');
repeat
Wait(500 + Random(200));
If FindDTM(NormLog,x ,y ,MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 1, 1, False);
Wait(1000+Random(200));
ChooseOption('ell 10');
wait(500+Random(250));
until Not (FindDTM(NormLog,x ,y ,MIX1, MIY1, MIX2, MIY2))
Sold := Sold + 1
TotSold := TotSold + 1
If Not DTMRotated(MainSeller, x, y, mSx1, mSy1, mSx2, mSy2) or DTMRotated(OtherSeller, x, y, mSx1, mSy1, mSx2, mSy2) then
begin
If FindSymbol(x, y, 'gen Store') then
Mouse(x, y, 1, 1, True);
Look := Look + 1
end;
end;
until (Look > (TimesLook))
If not FindDTM(NormLog,x ,y ,MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('Didnt find any logs going back to cutting');
If DTMRotated(AfterSellDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
Mouse(x, y, 1, 1, True);
Writeln('Found AfterSellDDTM');
If DTMRotated(FindTreeDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
Mouse(x, y, 1, 1, True);
Writeln(' Found FindTreeDDTM');
end;
If (TeleNeeded) then
HomeTele;
end;
end;
Procedure ChopTree;
var
TTries, Missed : Integer;
begin
If Not(LoggedIn) then Exit;
Flag;
repeat
If FindObjCustom(x, y, ['ut', 'ree'], [TreeColor0, TreeColor1, TreeColor2], 5) then
Mmouse(x, y, 1, 1);
If IsUpText('ree') then
FindNormalRandoms;
Mouse(x, y, 1, 1, True);
TTries := TTries + 1
If FindEnt(x, y, False) then
begin
Writeln('ent found');
setrun(False);
If DTMRotated(FindTreeDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
FindNormalRandoms;
FTWait(60);
end;
If not DTMRotated(FindTreeDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
If FindSymbol(x, y, 'guide') then
Mouse(x, y, 1, 1, True);
FindNormalRandoms;
FTWait(60);
end;
end;
If Not FindObjCustom(x, y, ['ut', 'ree'], [TreeColor0, TreeColor1, TreeColor2], 5) then
FTWait(60);
Missed := Missed + 1
until (InvFull) or (TTries > 30) or (Missed > 50)
end;
procedure ActiveLeft;
var
I : Integer;
begin
for
I := 0 To HowManyPlayers - 1 do
begin
if (Players[i].active = True) then Active := Active + 1;
If (Active = 0) then
begin
WriteLn('All Players done :)');
exit;
end;
If (Active > 0) then
WriteLn('' + IntToStr(Active) + ' Players Remaining.');
end;
end;
Procedure Login;
begin
SetupSRL;
ClearDebug;
ScriptID := '664';
SRLID := yourSRLID;
SRLPassword := yourSRLPW;
LoadDDTM;
DeclarePlayers;
activateclient;
LoginPlayer;
wait(3000+Random(2000));
MarkTime(AntiRandom);
end;
begin
If not (loggedin) then Login;
Repeat
start := GetSkillInfo('woodcutting', false);
Hometele;
If (DetermineBobVisit) then
GetAxe;
Bobbing;
Trees2;
repeat
ChopTree;
Sell;
until TimeFromMark(AntiRandom) >= 1800000
If not (DetermineBobVisit) then
ToTrees;
repeat
ChopTree;
Sell;
until TimeFromMark(AntiRandom) >= 1800000
If (TimeFromMark(AntiRandom) >= 1800000) then
Proc := GetSkillInfo('woodcutting', false);
Proggie;
Sold := 0;
NextPlayer(True);
Writeln('Changing player to avoid many randoms');
until (Active = 0)
If (Active = 0) then
TerminateScript;
end.but i always end up with
Successfully compiled
[Runtime Error] : Exception: Access violation at address 020B10AB in module 'Embedded SMART.dll'.since its a runtime error it tells me the script is fine (it compiles and runs without smart) but as soon as i add smart to it i get a runtime error immediately after.
Any ideas??
~Spaz