Log in

View Full Version : ChooseOption Problem. Someone Help Please!



Supertrent1
01-28-2012, 03:22 AM
Okay I am getting an issue. The problem is this:


[Error] (95:11): Type mismatch at line 94

The whole code script is This

program SuperPowerChopper;

//{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}

const
Version = '1.0 Alpha';
NumbOfPlayers = 1;
StartPlayer = 0;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;

Function ChopDown: Boolean;
Var
x, y , PlusOne, TreeCounter: Integer;

Begin;
PlusOne:= InvCount + 1
x:= MSCX;
y:= MSCY;
If FindObjTPA(x, y, 3161417, 3, 1, 15, 60, 600, ['Chop']) Then
Begin
StatsGuise('Horay, We found a tree');
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
Wait(100+Random(100));
WaitOption('Chop', 500);
End;

End;

Flag;

Repeat;
MarkTime(TreeCounter);
Antiban;
wait(1000);
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 3500)


End;

End;
Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[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];

For I:=0 To 27 Do
Begin
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem (LogPattern[I], False)
ChooseOption ('Drop');
End;
End;


End;





Begin
SetupSRL;
DeclarePlayers;
repeat
ChopDown;
if InvFull Then
DropLogs;
Until (false);

end

the part I am at is this:

Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[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];

For I:=0 To 27 Do
Begin
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem (LogPattern[I], False)
ChooseOption ('Drop');
End;
End;


End;

The Line I am having a problem with is this one:

ChooseOption ('Drop');

Any help or constructive cristicism is wanted and needed.

This is the first script I have EVER tried to make so thanks to everyone!

:spot:

RISK
01-28-2012, 03:24 AM
You have a space in your ChooseOption.
Oh and you are using the wrong stuff for MouseItem and you forgot to put a ';' at the end of it.

Fixed version:
Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[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];

For I:=0 To 27 Do
Begin
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(LogPattern[I], 1);
ChooseOption('Drop');
End;
End;


End;

By the way, don't forget to free that DTM. :)

Supertrent1
01-28-2012, 03:28 AM
You have a space in your ChooseOption.
Oh and you are using the wrong stuff for MouseItem and you forgot to put a ';' at the end of it.

Fixed version:
Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[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];

For I:=0 To 27 Do
Begin
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(LogPattern[I], 1);
ChooseOption('Drop');
End;
End;


End;

By the way, don't forget to free that DTM. :)

That was quick! And thanks, I'm on my way to becoming a SRL Member myself now :)

Supertrent1
01-28-2012, 03:32 AM
Also, Is this better?


Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[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];

For I:=0 To 27 Do
Begin
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(LogPattern[I], 1);
ChooseOption('Drop');
End;
End;

FreeDTM(LogDTM);


End;

I did that but now I am getting

[Error] (1:1): period ('.') expected at line 0

Any idea?
Thank for the help :):spongebob:

RISK
01-28-2012, 03:36 AM
You don't have a '.' at the end of your begin end. loop at the bottom.

Fixed version:
Begin
SetupSRL;
DeclarePlayers;
repeat
ChopDown;
if InvFull Then
DropLogs;
Until (false);

end.

Supertrent1
01-28-2012, 03:42 AM
You don't have a '.' at the end of your begin end. loop at the bottom.

Fixed version:
Begin
SetupSRL;
DeclarePlayers;
repeat
ChopDown;
if InvFull Then
DropLogs;
Until (false);

end.

You sir, are amazing. It is people like you that make me want to script more. I wish there was a plus rep system or something so I could show how much help you are :D (If there is, just tell me what to do)

Adobe
01-28-2012, 03:45 AM
You sir, are amazing. It is people like you that make me want to script more. I wish there was a plus rep system or something so I could show how much help you are :D (If there is, just tell me what to do)

There is a rep'ish' system, check pic http://prntscr.com/5nw1h

RISK
01-28-2012, 03:45 AM
Thank you very much for the compliment. :) I appreciate it.
You can rep me, even though it's not needed, but I appreciate it, by clicking the blue checkmark button on one of my posts. It's next to the red x mark which is the report button.

Supertrent1
01-28-2012, 04:09 AM
Thank you very much for the compliment. :) I appreciate it.
You can rep me, even though it's not needed, but I appreciate it, by clicking the blue checkmark button on one of my posts. It's next to the red x mark which is the report button.

Rep'd. Now I have another question. When My script tried to drop the logs it is just left clicking on them instead of rick clicking and going to drop. Here is a video of it in action

http://www.youtube.com/watch?v=ccfUuDTui8M

Here is the current script


Program SuperPowerChopper;

//{$DEFINE SMART}
{.include SRL\SRL.simba}
{.Include SRL\SRL\Misc\Debug.simba}

const
Version = '1.0 Alpha';
NumbOfPlayers = 1;
StartPlayer = 0;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;

Function ChopDown: Boolean;
Var
x, y , PlusOne, TreeCounter: Integer;

Begin;
PlusOne:= InvCount + 1
x:= MSCX;
y:= MSCY;
If FindObjTPA(x, y, 2964292, 3, 1, 15, 60, 600, ['Chop']) Then
Begin
StatsGuise('Horay, We found a tree');
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
Wait(100+Random(100));
WaitOption('Chop', 500);
End;

End;

Flag;

Repeat;
MarkTime(TreeCounter);
Antiban;
wait(1000);
Until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 3500)


End;

End;
Procedure DropLogs;
Var
x, y, LogDTM, I:Integer;
SlotBox:TBox;
LogPattern:TIntegerArray;

Begin

LogDTM := DTMFromString('mwQAAAHic42RgYHBmYmBwBGIfIA4EYicgNg ZiEyA2B2IvIH4KVHcbiB8D8Ssgfg/Ebxgg4neB+CYQe5rJA0kmDOxmKAqmbXSlGAiB/0DMSASGAwDH/w0r');
LogPattern:=[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];

For I:=0 To 27 Do
Begin
SlotBox:=InvBox(LogPattern[I]);
If FindDtm(LogDTM, x, y, SlotBox.X1, SlotBox.Y1, SlotBox.X2, SlotBox.Y2) Then
Begin
MouseItem(LogPattern[I], 1);
ChooseOption('Drop');
End;
End;

FreeDTM(LogDTM);


End;





Begin
SetupSRL;
DeclarePlayers;
repeat
ChopDown;
if InvFull Then
DropLogs;
Until (false);

end.

RISK
01-28-2012, 04:12 AM
Try 2 instead of 1. :o

E: You can use MOUSE_LEFT or MOUSE_RIGHT instead, by the way.

Supertrent1
01-28-2012, 04:17 AM
Try 2 instead of 1. :o

E: You can use MOUSE_LEFT or MOUSE_RIGHT instead, by the way.

I know this but I don't see where I put "1" in the dropping procedure
:redface:

RISK
01-28-2012, 04:18 AM
MouseItem(..., 1); to MouseItem(..., MOUSE_RIGHT);
If I'm correct.

Supertrent1
01-28-2012, 04:26 AM
MouseItem(..., 1); to MouseItem(..., MOUSE_RIGHT);
If I'm correct.
You're amazing :p