Lisafishes
2013-02-26 13:02:22
I am making a DTM to drop clay by following the youtube tut and it's showing a type mismatch error on the MouseItem line can someone help me figure it out please?
2013-02-26 13:02:22
2013-02-26 13:07:25
[/simba[ tags as well. (the second '[' for the end should be ']' )
2013-02-26 13:08:50
2013-02-26 13:13:58
program ClayCrafter;
{$DEFINE SMART8}
{$I SRL\SRL.simba}
{$I SRL\SRL\misc\Debug.simba}
{$I Srl/Srl/Skill/Mining.Simba}
{$I Srl/Srl/Skill/Crafting.Simba}
Const
Version = 1.0;
Rock = 'clay'; //What rock to mine
Pick = 'wield';//Wield your pick or carry it? Valid options are: 'wield' or 'store'.
{For Alching}
SFS = True; // ***Set To True if Alching And Using FireStaff (Any fire rune substitute staff will work)***
JIC = True; // ***True = Bank False = drop***
Alch = '5'; // ***Which key do you have the low alch spell bound to?***
PotLid = '1'; // ***Which key do you have pot lids bound to?***
SoftClay = '2'; // ***Which key do you have soft clay bound to?***
ClayOre = '3'; // ***Which key do you have clay ore bound to?***
LoadsTotal = 9999; //How Many Total Lods To Do Per Character!
PaintEvery = 5; //Update level paint intervals
Procedure ProgressReport ; Forward;
Var RockPattern: Array Of TIntegerArray;
Var TOres,TLoads,WeMined,StartTime,GemDTM:Integer;
Var RT, ChatBox, TExperiance, LastPainted:Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; // Player username
Pass := ''; // Player password
BoxRewards := ['XP', 'ostume', 'mote', 'oins', 'une', 'ssence'];
LampSkill := Skill_Mining;
Active := True;
end;
end;
procedure ProgressReport;
var Sec,Orerate,LoadRate:integer;
begin
SRLRandomsReport;
Stats_Commit;
Sec:= (1+((Getsystemtime-PlayerStartTime)/1000));
OreRate:=(3600*(TOres))/(Sec);
LoadRate:=(3600*(TLoads))/(Sec);
Writeln(' ');
Writeln ('/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\');
Writeln ('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
Writeln('| Worked for '+ TimeRunning);
Writeln('| Mined '+IntToStr(TOres)+' ores at a rate of '+IntToStr(OreRate)+' per hour');
Writeln('| Mined '+IntToStr(TLoads)+' loads at a rate of '+IntToStr(LoadRate)+' per hour');
Writeln ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
end;
procedure PlayerStats;
var Active: string;
i: Integer;
begin
Writeln ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
Writeln('# : Nick = A : Level Worked Mined Loads XP Location');
for i := 0 to HowManyPlayers - 1 do
begin
if (Players[i].Active) then Active:='T' else Active:='F';
Writeln(Padr(Inttostr(I),2) + ': ' + Padr(Players[i].Nick,4) + ' = ' + Padr(Active,5)
+''+Padr(inttostr(Players[i].level[15]),5)+''
+''+Padr(MsToTime(PlayerWorked(i),Time_Bare),11)+''
+''+Padr(IntToStr(Players[i].integers[80]),7)+''
+''+Padr(IntToStr(Players[i].integers[81]),6)+''
+''+Padr(FloatToStr((Players[i].integers[80])*(Players[i].Extendeds[1])),6)+''
+'L:'+Players[i].Loc);
end;
Writeln ('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>');
end;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 150) Then
Begin
Result:=True;
GetMousePos(x, y);
Case RClick Of
'R':
Begin
Mouse(x, y, 0, 0, False);
WaitOption('ine', 150);
//FFlag(3);
End;
'L':
Begin
Mouse(x, y, 0, 0,True);
//FFlag(3);
End;
End;
End;
End;
Procedure Antiban;
Begin
Case Random(20000) Of
0:
Begin
HoverSkill('Mining', False);
GameTab(Tab_Inv);
End;
1:
Begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
End;
2: ExamineInv;
3:
Begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
End;
4:
Begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
End;
5:
Begin
HoverSkill('random', False);
GameTab(Tab_Inv);
End;
End;
End;
Function MineClay: Boolean;
var
cx, cy, RockCounter, PlusOne: Integer;
begin
PlusOne:= InvCount + 1;
cx:=MSCX;
cy:=MSCY;
If FindObjCustom(cx, cy, ['cla', 'lay'], [8618883, 9163515, 9229565, 8833777], 50) Then
StatsGuise ('Booyah!');
GetMousePos (cx, cy);
Case Random (3) Of
0: Mouse (cx, cy, 1, 4, True);
1: Begin
Mouse (cx, cy, 1, 3, False);
WaitOption ('Mine', 500);
End;
2: Mouse (cx, cy, 5, 5, True);
End;
Flag;
Repeat
MarkTime(RockCounter);
Antiban;
Wait (1500);
If InvCount=PlusOne Then
WriteLn ('Got some clay');
Until (InvCount=PlusOne) or (TimeFromMark(RockCounter) > 4000)
If InvFull Then
// walkToWell; Else
end;
Procedure DropClay;
var
cx, cy, claydtm, I:Integer;
SlotBox:TBox;
ClayPattern:TIntegerArray;
Begin
ClayDTM := DTMFromString('mbQAAAHicY2VgYHBgYmDwY4LQFkDsCsTijAwMIkCsAMRiQMwLxPVZbgzu9sYMBgoKYBqE0cF/IGbEgsEAAJxvBpw=');
ClayPattern:=[1, 5, 9, 13, 17, 21, 25, 2, 6, 10, 14, 18, 22, 26, 3, 7, 11, 14, 19, 23, 27, 4, 8, 12, 15, 20, 24, 28];
For I:= 0 To 27 Do
Begin
SlotBox:=InvBox(ClayPattern[I]);
If FindDTM(ClayDTM, cx, cy, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(ClayPattern[I],False);
ChooseOption('Dro');
End;
End;
End;
Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
ProgressReport;
TerminateScript;
End;
{*******************************************************************************
Procedure ProgXP;
By: YoHoJo
Description: Calculates player's XP for progress reprot
*******************************************************************************}
Procedure ProgXP;
var I:Integer;
Begin
For I:=0 to HowManyPlayers -1 Do
Begin
Case Players[i].Integers[1] Of
1,2,3: Players[i].Extendeds[1]:=17.5;
4: Players[i].Extendeds[1]:=35;
5: Players[i].Extendeds[1]:=50;
End;
End;
End;
Procedure BasicSetup;
Begin
SetArrayLength(RockPattern,2);
RockPattern[0]:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28];
RockPattern[1]:=[1,5,9,13,17,21,25,26,22,18,14,10,6,2,3,7,11,15,19,23,27,28,24,20,16,12,8,4];
End;
Procedure DebugXP;
Var
Sec, XPRate:integer;
Begin
Sec:= (1+((Getsystemtime-StartTime)/1000));
XPRate:=(3600*(TExperiance))/(Sec);
StatsGuise(GroupDigits(XPRate, ',') + ' xp/h');
End;
procedure EndScript(Reason : String);
begin
Disguise('Stopped');
Writeln(Reason);
PlaySound('C:\Simba\sound.wav');
TerminateScript;
end;
procedure Terminate;
begin
Writeln('Thanks for using Claycrafter!');
PlaySound('C:\Simba\sound.wav');
//SmartSetEnabled(false);
end;
begin
Smart_FixSpeed:=True;
SRL_SixHourFix:=True;
SetupSRL;
MouseSpeed:=50;
DeclarePlayers;
StartTime:=GetSystemTime;
ProgXP;
BasicSetup;
TOres:=0;
MarkTime(LastPainted);
FindNormalRandoms;
StatsGuise(Players[CurrentPlayer].Nick + ' logging in');
LoginPlayer; if (SRL_Logs < 1) then SRL_Logs := 1;
Players[CurrentPlayer].Integers[82]:=0; //Temp Loads
Players[CurrentPlayer].Level[15]:= GetSkillLevel(Skill_Mining);
GameTab(Tab_Inv);
StatsGuise(Players[CurrentPlayer].Nick + ' Mining Lv ' +IntToStr(Players[CurrentPlayer].Level[15]));
SetRun(True);
SetAngle(SRL_ANGLE_HIGH);
FindNormalRandoms;
Repeat
MineClay;
Until (False);
end.
2013-02-26 13:33:26
InvMouse(ClayPattern[i], mouse_right); as it is a newer function that should accomplish your same goal.
2013-02-26 13:43:09
From: nivek1989
I'm not sure offhand, but I would suggest trying usingas it is a newer function that should accomplish your same goal.InvMouse(ClayPattern[i], mouse_right);