007demon700
10-11-2006, 01:29 AM
this might help this is the error i get now
Line 91: [Error] (485:47): Type mismatch in script C:\Program Files\SCAR 2.03\includes\srl\srl\core\Setup.scar
this is the script im trying to run
Program PowerMiner;
{.Include SRL/SRL.Scar}
{.Include SRL/SRL/Misc/Trade.Scar}
{.Include SRL/SRL/Skill/Mining.Scar}
{.Include SRL/SRL/Misc/PlayerForm.Scar}
{.Include SRL/SRL/Extended/xMapWalk.Scar}
//----------------------------------------------------------------------------//
Var
OreMask: Integer;
Var
MineSymbolColor: Integer;
Var
TraderName: String;
Var
EvilChicken, EvilChickens: Integer;
Var
Loads, TotalAmount, EXP: Integer;
Var
LostPick: Boolean;
//----------------------------------------------------------------------------//
Var
PowerForm: TForm;
WaitLabel, LoadLabel: TLabel;
OreComboBox, RunComboBox : TComboBox;
WaitEdit, LoadEdit: TEdit;
AntiCheckBox, EquipCheckBox : TCheckBox;
PlayManButton, StartButton : TButton;
Var
WaitTime, LoadsToDo: Integer;
Var
UseAntiBan, EPick: Boolean;
Var
OreType, RunDirection: String;
Var
FormPic: Integer;
//----------------------------------------------------------------------------//
Procedure StartSend(Sender: TObject);
Begin
PowerForm.ModalResult:= mrOk;
FreeBitmap(FormPic);
WaitTime:= StrToInt(WaitEdit.Text);
LoadsToDo:= StrToInt(LoadEdit.Text);
Case OreComboBox.Text of
'Copper' : Begin OreType:= 'Copper' WriteLn('Power Mining? - Copper'); end
'Tin' : Begin OreType:= 'Tin' WriteLn('Power Mining? - Tin'); end
'Iron' : Begin OreType:= 'Iron' WriteLn('Power Mining? - Iron'); end
End
WriteLn('WaitTime? - '+IntToStr(WaitTime));
WriteLn('Loads To Do? - '+IntToStr(LoadsToDo));
If(AntiCheckBox.State = cbChecked)then
Begin
UseAntiBan:= True;
WriteLn('Use Antiban? - Yes');
End else
Begin
UseAntiBan:= False;
WriteLn('Use Antiban? - No');
End;
If(EquipCheckBox.State = cbChecked)then
Begin
EPick:= True;
WriteLn('Equip Pick? - Yes');
End else
Begin
EPick:= False;
WriteLn('Equip Pick? - No');
End;
Case RunComboBox.Text of
'North' : Begin RunDirection:= 'N' WriteLn('Run Direction? - North'); end
'South' : Begin RunDirection:= 'S' WriteLn('Run Direction? - South'); end
'East' : Begin RunDirection:= 'E' WriteLn('Run Direction? - East'); end
'West' : Begin RunDirection:= 'W' WriteLn('Run Direction? - West'); end
End
End;
Procedure PlayerSend(Sender: TObject);
Begin
SetupPlayers;
End;
Procedure SafePaint;
Var
Canvas: TCanvas;
Begin
Canvas:= GetBitmapCanvas(FormPic);
SafeCopyCanvas(Canvas, PowerForm.Canvas, 0, 0, 500, 500, 0, 0, 500, 500);
End;
Procedure PaintForm(Sender:TObject);
Begin
SafePaint;
End;
Procedure Form;
Begin
PowerForm := CreateForm;
PowerForm.Left := 347;
PowerForm.Top := 183;
PowerForm.BorderIcons := [biSystemMenu];
PowerForm.OnPaint := @PaintForm;
PowerForm.BorderStyle := bsToolWindow;
PowerForm.Caption := 'ChArM'#39's Power Miner';
PowerForm.ClientHeight := 200;
PowerForm.ClientWidth := 175;
PowerForm.Color := clBtnFace;
PowerForm.Font.Color := clWindowText;
PowerForm.Font.Height := -11;
PowerForm.Font.Name := 'Comic Sans MS';
PowerForm.Font.Style := [];
PowerForm.Visible := False;
PowerForm.PixelsPerInch := 96;
WaitLabel := TLabel.Create(PowerForm);
WaitLabel.Parent := PowerForm;
WaitLabel.Font.Color := clWhite;
WaitLabel.Left := 26;
WaitLabel.Top := 46;
WaitLabel.Width := 60;
WaitLabel.Height := 15;
WaitLabel.Caption := 'Wait Time?';
LoadLabel := TLabel.Create(PowerForm);
LoadLabel.Parent := PowerForm;
LoadLabel.Font.Color := clWhite;
LoadLabel.Left := 21;
LoadLabel.Top := 73;
LoadLabel.Width := 68;
LoadLabel.Height := 15;
LoadLabel.Caption := 'Loads To Do?';
OreComboBox := TComboBox.Create(PowerForm);
OreComboBox.Parent := PowerForm;
OreComboBox.Left := 41;
OreComboBox.Top := 10;
OreComboBox.Width := 90;
OreComboBox.Height := 23;
OreComboBox.Hint := 'Type of rock you wish to powermine.';
OreComboBox.DropDownCount := 3;
OreComboBox.ItemHeight := 15;
OreComboBox.ParentShowHint := False;
OreComboBox.ShowHint := True;
OreComboBox.TabOrder := 8;
OreComboBox.Items.Add('Copper');
OreComboBox.Items.Add('Tin');
OreComboBox.Items.Add('Iron');
WaitEdit := TEdit.Create(PowerForm);
WaitEdit.Parent := PowerForm;
WaitEdit.Left := 95;
WaitEdit.Top := 42;
WaitEdit.Width := 50;
WaitEdit.Height := 23;
WaitEdit.Hint :=
'Amount of time in seconds to wait before switching rocks, used a' +
's a backup.';
WaitEdit.ParentShowHint := False;
WaitEdit.ShowHint := True;
WaitEdit.TabOrder := 9;
WaitEdit.Text := '2';
LoadEdit := TEdit.Create(PowerForm);
LoadEdit.Parent := PowerForm;
LoadEdit.Left := 95;
LoadEdit.Top := 70;
LoadEdit.Width := 50;
LoadEdit.Height := 23;
LoadEdit.Hint := 'Amount of loads you wish to do before switching players.';
LoadEdit.ParentShowHint := False;
LoadEdit.ShowHint := True;
LoadEdit.TabOrder := 10;
LoadEdit.Text := '500';
AntiCheckBox := TCheckBox.Create(PowerForm);
AntiCheckBox.Parent := PowerForm;
AntiCheckBox.Left := 36;
AntiCheckBox.Top := 97;
AntiCheckBox.Width := 102;
AntiCheckBox.Height := 17;
AntiCheckBox.Hint := 'Check if you wish to enable the antiban procedures.';
AntiCheckBox.Caption := 'Enable AntiBan?';
AntiCheckBox.ParentShowHint := False;
AntiCheckBox.ShowHint := True;
AntiCheckBox.TabOrder := 11;
EquipCheckBox := TCheckBox.Create(PowerForm);
EquipCheckBox.Parent := PowerForm;
EquipCheckBox.Left := 46;
EquipCheckBox.Top := 119;
EquipCheckBox.Width := 79;
EquipCheckBox.Height := 17;
EquipCheckBox.Hint := 'Check if you wish to wield your pickaxe.';
EquipCheckBox.Caption := 'Equip Pick?';
EquipCheckBox.ParentShowHint := False;
EquipCheckBox.ShowHint := True;
EquipCheckBox.TabOrder := 15;
RunComboBox := TComboBox.Create(PowerForm);
RunComboBox.Parent := PowerForm;
RunComboBox.Left := 41;
RunComboBox.Top := 142;
RunComboBox.Width := 90;
RunComboBox.Height := 23;
RunComboBox.Hint := 'Direction you wish to run, if attacked.';
RunComboBox.DropDownCount := 4;
RunComboBox.ItemHeight := 15;
RunComboBox.ParentShowHint := False;
RunComboBox.ShowHint := True;
RunComboBox.TabOrder := 12;
RunComboBox.Items.Add('North');
RunComboBox.Items.Add('South');
RunComboBox.Items.Add('East');
RunComboBox.Items.Add('West');
PlayManButton := TButton.Create(PowerForm);
PlayManButton.Parent := PowerForm;
PlayManButton.Left := 2;
PlayManButton.Top := 172;
PlayManButton.Width := 91;
PlayManButton.Height := 25;
PlayManButton.Hint := 'Click to setup your players.';
PlayManButton.Caption := 'Player Manager';
PlayManButton.ParentShowHint := False;
PlayManButton.ShowHint := True;
PlayManButton.OnClick := @PlayerSend;
PlayManButton.TabOrder := 13;
StartButton := TButton.Create(PowerForm);
StartButton.Parent := PowerForm;
StartButton.Left := 98;
StartButton.Top := 172;
StartButton.Width := 75;
StartButton.Height := 25;
StartButton.Hint := 'Click to start the power miner.';
StartButton.Caption := 'Start';
StartButton.ParentShowHint := False;
StartButton.ShowHint := True;
StartButton.OnClick := @StartSend;
StartButton.TabOrder := 14;
End;
Procedure SafeForm;
Var
v: TVariantArray;
Begin
SetArrayLength(V, 0);
ThreadSafeCall('Form', v);
End;
Procedure ShowFormMod;
Begin
PowerForm.ShowModal;
End;
Procedure SafeShowFormMod;
Var
v: TVariantArray;
Begin
SetArrayLength(V, 0);
ThreadSafeCall('ShowFormMod', v);
End;
//----------------------------------------------------------------------------//
Procedure Bitmaps;
Begin
OreMask := BitmapFromString(11, 11, 'z78DA73730301033070436' +
'2238B60024C35B84CC0A5923C13F0BB937813F0EB22DE04CC 5022' +
'CF04CADD404CC890EA0BFCE2F85D4E4C6A212FF470998FCC0 600F' +
'B599CC1');
End;
//----------------------------------------------------------------------------//
Procedure SetupOreColors;
Begin
Case (OreType) of
'Copper' : OreColor:= 4022662;
'Tin' : OreColor:= 9013909;
'Iron' : OreColor:= 2503764;
End;
End;
//----------------------------------------------------------------------------//
Function FindMineSymbolColor: Boolean;
Begin
Repeat
MineSymbolColor:= GetSymbolColor(x, y, 'mining spot')
SymbolAccuracy:= SymbolAccuracy-0.1;
Until(SymbolAccuracy= 0.4) or (MineSymbolColor > 0);
If(MineSymbolColor > 0)then
Begin
WriteLn('MineSymbolColor - '+IntToStr(MineSymbolColor));
SymbolAccuracy:= 0.8;
Result:= True;
End else
Begin
WriteLn('Couldn''t find mine symbol color!');
SymbolAccuracy:= 0.8;
End;
End;
Procedure RelocateToMine;
Begin
FindMineSymbolColor;
If(FindColorSpiralTolerance(x, y, MineSymbolColor, MMX1, MMY1, MMX2, MMY2, 10)) or (FindSymbol(x, y, 'mining spot'))then
Begin
Mouse(x, y, 4, 4, True);
Flag;
End;
End;
//----------------------------------------------------------------------------//
Procedure ExitWindow;
Var
Close: Integer;
Begin
Close := BitmapFromString(10, 11, 'z78DA3330000243033069E66' +
'4EA62628C9F3440528F4912AF0BBF38015913537313430889 DF3D' +
'505D48EA3149F274E13201971A533753236367641297BD982 A89D' +
'185DF04FC6A70C96211B7347131B6C42409B807872E5C2600 00D9' +
'5685F1');
If(FindBitmapToleranceIn(Close, x, y, MSX1, MSY1, MSX2, MSY2, 10))then
Begin
MMouse(x, y, 3, 3);
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
End;
FreeBitmap(Close);
End;
//----------------------------------------------------------------------------//
Function HandleTrade: Boolean;
Var
TradeMark: LongInt;
Begin
If(AcceptTrade) or (TradeScreen)then
Begin
Result:= True;
Wait(1000+Random(500));
TraderName:= GetTraderName;
ClickAllItemsBmpMaskTolWait('ffer', OreMask, 20, 25, 30+Random(30));
Wait(1000+Random(500));
Accept;
MarkTime(TradeMark)
While(not PlayerAccepted) and (TimeFromMark(TradeMark) < 15000) do Wait(1000+Random(500));
If(TimeFromMark(TradeMark) > 15000)then Decline;
Accept;
MarkTime(TradeMark)
While (TradeScreen2) and (TimeFromMark(TradeMark) < 15000) do Wait(1000+Random(501));
If(TimeFromMark(TradeMark) > 15000)then Decline;
If(TimeFromMark(TradeMark) > 15000)then TypeSend('Thanks '+TraderName)
Else TypeSend('What do u want '+TraderName)
Trades:= Trades + 1;
ExitWindow;
End;
End;
//----------------------------------------------------------------------------//
Function FindEvilChicken: Boolean; //By Dankness
Var
CX, CY: Integer;
Begin
If(EvilChicken= 0)then
EvilChicken:= CreateBitmapMaskFromText('egone,', UpChars);
If(FindName)then
If(FindBitmapMaskTolerance(EvilChicken, CX, CY, 3, 3, 515, 336, 0, 40))then
Begin
Result:= True;
EvilChickens:= EvilChickens + 1;
WriteLn('******** FOUND EVIL CHICKEN RANDOM ********');
WriteFileString(TheFile, '******** FOUND EVIL CHICKEN RANDOM ********' +Chr(13));
End;
End;
Function FindPickHead: Boolean; //Edited, Just a Bit
Var
C, XH, YH: Integer;
ReEquipPick: Boolean;
Begin
GameTab(4);
Result:= True;
If(FindBitmapToleranceIn(PickHandle, x, y, MIX1, MIY1, MIX2, MIY2, 30))or
(GetColor(472, 380)= 0) and (GetColor(482, 383)= 0)then
Begin
GameTab(5);
Wait(750+Random(250));
If(GetColor(604, 300)= 65536) and (GetColor(601, 298)= 65536)then
Begin
WriteLn('Broken Pickaxe..');
NoPick:= True;
LostPick:= True;
GameTab(4);
Result:= False;
Exit;
End;
GameTab(4);
Wait(2000+Random(100));
If(FindBitmapMaskTolerance(OreMask, x, y, 559, 210, 735, 460, 10, 5))then
Begin
MMouse(x, y, 5, 5);
Mouse(x, y, 0, 0, False);
ChooseOption(x, y, 'rop');
End
Repeat
If(not(LoggedIn))then Exit;
C:= C + 1;
x:= Random(510)+5;
y:= Random(330)+5;
If(FindColorSpiral(x, y, hc1, MSX1, MSY1, MSX2, MSY2))or
(FindColorSpiral(x, y, hc2, MSX1, MSY1, MSX2, MSY2))or
(FindColorSpiral(x, y, hc3, MSX1, MSY1, MSX2, MSY2))or
(FindColorSpiral(x, y, hc4, MSX1, MSY1, MSX2, MSY2))or
(FindColorSpiral(x, y, hc5, MSX1, MSY1, MSX2, MSY2))then
Begin
MMouse(x, y, 0, 0);
If(IsUpText('ake'))then
Begin
GetMousePos(x, y);
Mouse(x, y, 1, 1, True);
End
Flag;
Wait(750+Random(250));
End else
If(PickUpItems)then
ItemGrab;
Until((FindBitmapToleranceIn(PickHead, x, y, MIX1, MIY1, MIX2, MIY2, 50)) or (C>=10));
If(not(FindBitmapToleranceIn(PickHead, x, y, MIX1, MIY1, MIX2, MIY2, 50)))then
Begin
NoPick:= True;
Result:= False;
LostPick:= True;
Exit;
End;
WriteLn('Found Head!');
LostPick:= False;
GameTab(5);
Wait(250+Random(100));
If(FindBitmapToleranceIn(PickHandle, XH, YH, 560, 280, 615, 322, 50))then
Begin
WriteLn('UnEquiping Handle..');
Mouse(XH, YH, 0, 0, True);
ReEquipPick:= True;
End;
Wait(250+Random(100));
GameTab(4);
Wait(250+Random(100));
If(FindItemBmpTol(PickHead, 50)) and (FindItemBmpTol(PickHandle, 50))then
Begin
ClickItemBmpTol(PickHead, 50, True);
Wait(750+Random(250));
ClickItemBmpTol(PickHandle, 50, True);
PickAxeAttached:= PickAxeAttached + 1;
WriteLn('Attached Head & Handle!');
NoPick:= False;
Result:= True;
If((EquipPick) or (ReEquipPick))then
Begin
Wait(2000+Random(1000));
ClickItemColor(hc1, True);
End;
End;
End;
End;
//----------------------------------------------------------------------------//
Procedure RunAway;
Begin
Case (Random(9+1)) of
0 : Begin TypeSend('ahh'); end
1 : Begin TypeSend('=S'); end
2 : Begin TypeSend('hah'); end
3 : Begin TypeSend('stupid randoms'); end
4 : Begin TypeSend('-.-'); end
5 : Begin TypeSend('ahh not again!'); end
6 : Begin TypeSend('0o0o'); end
7 : Begin TypeSend('Ahh!'); end
8 : Begin TypeSend('!!!!'); end
9 : Begin TypeSend('whoa'); end
10 : Begin TypeSend('=/'); end
End
RunAwayDirection(RunDirection);
Wait(8000+Random(2000));
RunBack;
End;
Procedure FindRandoms;
Begin
HandleTrade;
DwarfItem;
FindPickHead;
FindNormalRandoms;
If(FindFight) or (FindEvilChicken)then
Begin
RunAway;
End
End;
procedure RandWait(Main, Rand : Integer); //By WhiteShadow, Edited
Var
WTime, DivTime, I: Integer;
Begin
WTime:= Main+Random(Rand);
DivTime:= Trunc(WTime div 3);
Repeat
Wait(DivTime - Round(Rand div 4));
FindRandoms;
If(Random(24)= 2)then
SendArrowSilentWait(Random(3), 300+Random(200));
I:=I + 1;
Until(I >= 3);
End;
Function FlagRandWait: Boolean;
Var
FlagMark: Integer;
Begin
MarkTime(FlagMark);
If(not(FlagPresent))then
Begin
Result:= False;
Exit;
End
Else
Begin
Repeat
RandWait(100, 50);
If(not(LoggedIn))then Break;
Until(not(FlagPresent) or (TimeFromMark(FlagMark) > 12000) );
Result:= True;
End;
End;
//----------------------------------------------------------------------------//
Procedure AutoRespond;
Var
Responce: String;
RandomReply: Integer;
Begin
OldLine:= TheLine;
TheName:= Lowercase(Trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
TheLine:= Lowercase(Trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
NewLine:= TheLine;
If(OldLine=NewLine) or (Pos(Players[CurrentPlayer].Nick, TheName) <> 0)then
Begin
Exit;
End
If(InChat('mineing')) or (InChat('mine')) or (InChat('mining')) and (InChat('lvl')) or (InChat('lev')) or (InChat('level'))then
Begin
Responce:= IntToStr(GetSkillLevel('mining'));
TypeSend(Responce);
GameTab(4);
End;
If(InChat('what')) or (InChat('wat')) or (InChat('doin'))then
Begin
RandomReply:= Random(9)+1;
Case RandomReply of
1 : Responce:= ('mining');
2 : Responce:= ('bored');
3 : Responce:= ('aye?');
4 : Responce:= ('emmm..nothin');
5 : Responce:= ('nope');
6 : Responce:= ('booo');
7 : Responce:= ('no ty');
8 : Responce:= ('what');
9 : Responce:= ('....');
10 : Responce:= ('nothing you');
End;
TypeSend(Responce);
End;
If(InChat('lol')) or (InChat('lmao')) or (InChat('rofl')) or (InChat('haha'))then
Begin
RandomReply:= Random(24)+1;
Case RandomReply of
1 : Responce:= 'lolol';
2 : Responce:= 'lol';
3 : Responce:= 'haha';
4 : Responce:= 'hihi';
5 : Responce:= 'ghehe';
6 : Responce:= 'lmao';
7 : Responce:= 'lmfao';
8 : Responce:= 'rofls';
9 : Responce:= 'fun';
10 : Responce:= 'nice';
11 : Responce:= 'lolz';
12 : Responce:= 'yep';
13 : Responce:= 'hola';
14 : Responce:= 'wow';
15 : Responce:= 'i bet';
16 : Responce:= 'rofl';
17 : Responce:= 'ghehehghehighhe';
18 : Responce:= 'cool';
19 : Responce:= '...';
20 : Responce:= '???';
21 : Responce:= 'wowzers';
22 : Responce:= 'grrr...';
23 : Responce:= 'rowr';
24 : Responce:= 'lolololololol';
25 : Responce:= 'ha ha ha!!!';
End;
TypeSend(Responce);
End;
If(InChat(Players[CurrentPlayer].Name)) or (InChat(Players[CurrentPlayer].Nick))then
Begin
RandomReply:= Random(9)+1;
Case RandomReply of
1 : Responce:= ('what');
2 : Responce:= ('yes');
3 : Responce:= ('how can i help u lol');
4 : Responce:= ('what do you want');
5 : Responce:= ('me?');
6 : Responce:= ('Yah?');
7 : Responce:= ('who?');
8 : Responce:= ('wha?');
9 : Responce:= ('?');
10 : Responce:= ('???');
End;
TypeSend(Responce);
End;
If(InChat('hi')) or (InChat('hello')) or (InChat('hey'))then
Begin
RandomReply:= random(7)+1;
Case RandomReply of
1 : Responce:= ('sup');
2 : Responce:= ('yo');
3 : Responce:= ('whats up everyone');
4 : Responce:= ('whats up');
5 : Responce:= ('welcome');
6 : Responce:= ('allo allo');
7 : Responce:= ('wat up');
8 : Responce:= ('y0o');
9 : Responce:= ('=P');
10 : Responce:= ('what is up');
End;
TypeSend(Responce);
End;
End;
//----------------------------------------------------------------------------//
Procedure RCExamine;
Begin
MMouse(Random(MSX1), Random(MSY1), 3, 5);
If(IsUpText('opti')) or (IsUpText('alk here')) or (IsUpText('ine'))then
Begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Case(Random(2))of
0 : ChooseOption(x, y, 'Examine');
1 : ChooseOption(x, y, 'Cancel');
End;
Wait(Random(50)+Random(50));
End;
End;
Procedure RandomRClickExamineEvery(mins: Integer);
Begin
If((TimeFromMark(Mark)/1000)/60 >= mins)then
Begin
MarkTime(Mark);
RCExamine;
End;
End;
Procedure MoveAndRotate;
Begin
Case(Random(8+1))of
0 : SleepAndMoveMouse(1000+Random(2500));
1 : SleepAndMoveMouse(750+Random(2000));
2 : SleepAndMoveMouse(1500+Random(1000));
3 : SleepAndMoveMouse(1000+Random(500));
4 : SleepAndMoveMouse(500+Random(2000));
5 : SendArrowSilentWait(((Random(2)*2)), 1000+Random(200));
6 : SendArrowSilentWait(((Random(2)*2) + 1), 200+Random(200));
7 : SendArrowSilentWait(((Random(2)*2)), 200+Random(200));
8 : SendArrowSilentWait(((Random(2)*2) + 1), 20+Random(20));
9 : SendArrowSilentWait(((Random(2)*2)), 20+Random(20));
End;
End;
Procedure RandomMoveAndRotateEvery(mins: Integer);
Begin
If((TimeFromMark(Mark)/1000)/60 >= mins)then
Begin
MarkTime(Mark);
MoveAndRotate;
End;
End;
Procedure RandomGameTabEvery(mins : Integer);
Begin
If((TimeFromMark(Mark)/1000)/60 >= mins)then
Begin
MarkTime(Mark);
GameTab(1+Random(12));
End;
End;
Procedure MiningAntiBan;
Begin
If(UseAntiBan= True)then
Begin
RandomMoveAndRotateEvery(5 + Random(4));
RandomRClickExamineEvery(7 + Random(2));
RandomGameTabEvery(4 + Random(3));
RotateEvery(6 + Random(4));
PickUpMouseEvery(15 + Random(2));
LeaveScreenEvery(12 + Random(2));
HoverEvery(20 + Random(5), 'mining');
End;
End;
//----------------------------------------------------------------------------//
Procedure ChangeGasPixels(Var GasX, GasY: Integer); //By Wizzup?
Var
TempX, TempY: Integer;
Begin
If(FlagPresent)then
Begin
If(FindColorSpiralTolerance(x, y, OreColor, MSX1, MSY1, MSX2, MSY2, 4))then
Begin
x:= TempX;
y:= TempY;
If(CheckOre(x, y, OreColor, 4) > 2)then
Begin
If(Distance(MSCX, MSCY, TempX, Tempy) < 40)then
Begin
GasX:= x;
GasY:= y;
End;
End;
End;
End;
End;
Function FindOres: Boolean;
Var
EX, EY: Integer;
Begin
If(FindColorSpiralTolerance(EX, EY, OreColor, MSX1, MSY1 , MSX2, MSY2, 5))then
Begin
Result:= True;
End else
Begin
Result:= False;
WriteLn('Could not find rocks, relocating to mining symbol..');
RelocateToMine;
End;
End;
Function MineOres: Boolean;
Var
AX, AY, TempCount: Integer;
Begin
If(FindOres)then
TempCount:= InventoryCount;
If(FindObjOre(AX, AY, 'Mine', OreColor, 5, 2))then
Result:= True;
Begin
If(not(GasCheck(AX, AY))) then
Begin
If(Random (20) < 15)then
Begin
Mouse(AX, AY, 0, 0, True);
ChangeGasPixels(AX, AY);
End
Else
Begin
Mouse(AX, AY, 0, 0, False);
ChooseOption(x, y, 'Mine');
End
ChangeGasPixels(AX, AY);
If(FlagPresent)then
Begin
FlagRandWait;
End
MarkTime(Mark);
Repeat
If(not(LoggedIn))then Break;
If(GasCheck(Ax, Ay))then
Begin
Mouse(265, 165, 5, 5, True);
//AutoRespond;
RandWait(4000, 3000);
End;
//AutoRespond;
RandWait(150, 100);
FindPickHead;
Until(InventoryCount <> TempCount) or (IsChatMessage('You manage to mine')) or (IsChatMessage('There is no ore currently in this rock.')) or (TimeFromMark(Mark) > (1000*WaitTime));
End;
End;
End;
//----------------------------------------------------------------------------//
Procedure DropOres;
Begin
//AutoRespond;
Repeat
ClickAllItemsBmpMaskTolWait('rop', OreMask, 10, 5, 100);
DwarfItem;
Until(not(FindBitmapMaskTolerance(OreMask, x, y, MIX1, MIY1, MIX2, MIY2, 10, 5)));
FindRandoms;
End;
//----------------------------------------------------------------------------//
Procedure OreExp;
Begin
Case (OreType) of
'Tin' : EXP:= 17;
'Copper' : EXP:= 17;
'Iron' : EXP:= 35;
End;
End;
Procedure ProgressReport;
Var
MiningAvg: Integer;
Begin
OreExp;
ClearDebug;
MiningAvg:= (Loads * 27)/ScriptTime(2) * 60;
WriteLn(' ');
WriteLn('<[======================================]>');
WriteLn(' Worked for '+ScriptTime2(2)+'.');
WriteLn(' Mined '+IntToStr(TotalAmount)+' '+OreType+' ores.');
WriteLn(' Averaging '+IntToStr(MiningAvg)+' '+OreType+' ores an hour.');
WriteLn(' Gained '+IntToStr(TotalAmount*EXP)+' mineing exp.');
WriteLn('<[======================================]>');
SRLRandomsReport;
WriteLn(' ');
End;
//----------------------------------------------------------------------------//
Procedure Setup;
Begin
SetupSRL;
SetupSRLMining;
Bitmaps;
MouseSpeed:= 9;
PickUpItems:= True;
FormPic:= LoadBitmap('PowerMinerPic.bmp');
SafeForm;
SafeShowFormMod;
SetupOreColors;
EquipPick:= EPick;
ActivateClient;
If(not(LoggedIn))then
LoginPlayer;
PerfectNorth;
FindPickHeadColor;
ClearDebug;
End;
Begin
Setup;
Repeat
PerfectNorth;
MarkTime(Mark);
Repeat
If(not(LoggedIn))then Break;
MiningAntiBan;
MineOres;
FindRandoms;
Until(InvFull) or (InvCount= 28) or (TimeFromMark(Mark) >= (5*60000)) or (LostPick);
DropOres;
TotalAmount:= TotalAmount + 27;
Loads:= Loads + 1;
ProgressReport;
If(LoggedIn) and (LoadsToDo=Loads) or (LostPick)then
Begin
Loads:= 0;
NextPlayer(True);
End
If(not(LoggedIn))then NextPlayer(False);
Until(False);
End.
heres the thing i edited
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป User Saving/Loading Routines --//
//-----------------------------------------------------------------//
// * function getSRLData(dName : String): String; //* by Dankness
// * function setBoolean ( T : String ) : Boolean; //* by Dankness
// * procedure LoadSRLConfig; //* by Dankness
var
zFile : String;
//----------------------------------------------------------------------------//
//---> Reads Data from CFG File based on procedure by RSN
//----------------------------------------------------------------------------//
function getSRLData(dName : String): String;
var
tString: String;
begin
Result := '';
tString := dName + '=';
if(Pos(tString, zFile) = 0)then
Exit;
Result := zFile;
Delete(Result, 1, Pos(tString, zFile));
Result := Copy(Result, Length(tString), Pos(Chr(13), Result) - Length(tString));
end;
{************************************************* ******************************
function setBoolean ( T : String ) : Boolean;
By: Dankness
Description: Changes String to Boolean
************************************************** *****************************}
function setBoolean ( T : String ) : Boolean;
begin
if ( LowerCase ( T ) = 'true' ) then
Result := True
else
Result := False;
end;
{************************************************* ******************************
procedure SaveSRLConfig;
By: Dankness
Description: Creates SRL Configfile
************************************************** *****************************}
procedure SaveSRLConfig;
var aFile : Integer;
begin
Status ('Saving Settings to Config Data File');
aFile := ReWriteFile ( AppPath + 'SRL.CFG', False);
if(aFile < 0)then
Exit;
WriteFileString(aFile, 'Filename=Chars'+ Chr(13));
WriteFileString(aFile, 'Benmouse=True' + Chr(13));
WriteFileString(aFile, 'Mousespeed=15' + Chr(13));
WriteFileString(aFile, 'Lampskill=Mining' + Chr(13));
WriteFileString(aFile, 'UseSandwichSolver=True' + Chr(13));
WriteFileString(aFile, 'UseBoxSolver=True' + Chr(13));
WriteFileString(aFile, 'UseCerterSolver=False' + Chr(13));
WriteFileString(aFile, 'LogOutTime=False' + Chr(13));
WriteFileString(aFile, 'Check HP=True' + Chr(13));
WriteFileString(aFile, 'Screenshots=False' + Chr(13));
WriteFileString(aFile, 'DebugRadialRoad=True' + Chr(13));
CloseFile(aFile );
end;
{************************************************* ******************************
procedure LoadSRLConfig;
By: Dankness
Description: Loads Settings from Config Data file for Form
************************************************** *****************************}
procedure LoadSRLConfig;
var aFile : Integer;
begin
aFile := OpenFile ( AppPath + 'SRL.CFG', False);
if(aFile < 0)then
begin
SaveSRLConfig;
aFile := OpenFile ( AppPath + 'SRL.CFG', False);
end;
ReadFileString(aFile, zFile, FileSize(aFile));
Filename := getSRLData ( 'Filename' );
BenMouse := setBoolean (getSRLData ( 'Benmouse' ));
MouseSpeed := getSRLData ('MouseSpeed');
LampSkill := getSRLData ( 'Lampskill' );
UseSandwichSolver := setBoolean ( getSRLData ( 'UseSandwichSolver' ));
UseBoxSolver := setBoolean ( getSRLData ( 'UseBoxSolver' ));
UseCerterSolver := setBoolean ( getSRLData ( 'UseCerterSolver' ));
LogTimeOut := setBoolean ( getSRLData ( 'LogOutTime' ));
CheckHPFirst := setBoolean ( getSRLData ( 'Check HP' ));
Screenshots := setBoolean ( getSRLData ( 'Screenshots' ));
DebugRadialRoad := setBoolean ( getSRLData ( 'DebugRadialRoad' ));
CloseFile(aFile );
end;
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.