Log in

View Full Version : Function FindSpinTicket



iiNveRsioN
04-22-2012, 08:19 AM
function FindSpinTicket(): Boolean;
var
oneFreeSpin, x, y: Integer;
begin
oneFreeSpin := DTMFromString('mrAAAAHic42BgYMhlYmBIBuJyIC4F4hQgLg PiaiAuAeInQDWvgfg+ED8D4vdQDBK/BcS9BloMHXHWYMzLwwMUYULB/EASH2ZCw4xoGAYA/y4OqA==');

if (FindDTM(oneFreeSpin, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Move);

if (WaitUptext('laim', 300)) then
begin
ClickMouse2(mouse_Left);
Wait(RandomRange(100, 200));
Result := True;
end;
end;


What would I need to change to make this destroy the tickets and confirm destroy rather than claim them?

Total
04-22-2012, 08:23 AM
function FindSpinTicket(): Boolean;
var
oneFreeSpin, x, y: Integer;
begin
oneFreeSpin := DTMFromString('mrAAAAHic42BgYMhlYmBIBuJyIC4F4hQgLg PiaiAuAeInQDWvgfg+ED8D4vdQDBK/BcS9BloMHXHWYMzLwwMUYULB/EASH2ZCw4xoGAYA/y4OqA==');

if (FindDTM(oneFreeSpin, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Move);

if (WaitUptext('laim', 300)) then
begin
ClickMouse2(mouse_Right);
Wait(RandomRange(100, 200));
ChooseOption('estroy');
Result := True;
end;
end;


That is if the option is Destroy...don't really know what it is. Also if there is some sort of confirmation to destroy it won't click it. Don't know why you wouldn't want it though.

iiNveRsioN
04-22-2012, 08:25 AM
function FindSpinTicket(): Boolean;
var
oneFreeSpin, x, y: Integer;
begin
oneFreeSpin := DTMFromString('mrAAAAHic42BgYMhlYmBIBuJyIC4F4hQgLg PiaiAuAeInQDWvgfg+ED8D4vdQDBK/BcS9BloMHXHWYMzLwwMUYULB/EASH2ZCw4xoGAYA/y4OqA==');

if (FindDTM(oneFreeSpin, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Move);

if (WaitUptext('laim', 300)) then
begin
ClickMouse2(mouse_Right);
Wait(RandomRange(100, 200));
ChooseOption('estroy');
Result := True;
end;
end;


That is if the option is Destroy...don't really know what it is. Also if there is some sort of confirmation to destroy it won't click it.

It is destroy. There is also a confirmation, I'm sure there is something I can add on to that to make it confirm it though?

Total
04-22-2012, 08:27 AM
Well you need to know what the confirmation is.


function FindSpinTicket(): Boolean;
var
oneFreeSpin, x, y: Integer;
begin
oneFreeSpin := DTMFromString('mrAAAAHic42BgYMhlYmBIBuJyIC4F4hQgLg PiaiAuAeInQDWvgfg+ED8D4vdQDBK/BcS9BloMHXHWYMzLwwMUYULB/EASH2ZCw4xoGAYA/y4OqA==');

if (FindDTM(oneFreeSpin, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Move);

if (WaitUptext('laim', 300)) then
begin
ClickMouse2(mouse_Right);
Wait(RandomRange(100, 200));
ChooseOption('estroy');
Wait(RandomRange(300, 400));
FindNPCChatText('Whatever it says to confirm destroy in here', ClickLeft);
Result := True;
end;
end;

iiNveRsioN
04-22-2012, 08:30 AM
Well you need to know what the confirmation is.


function FindSpinTicket(): Boolean;
var
oneFreeSpin, x, y: Integer;
begin
oneFreeSpin := DTMFromString('mrAAAAHic42BgYMhlYmBIBuJyIC4F4hQgLg PiaiAuAeInQDWvgfg+ED8D4vdQDBK/BcS9BloMHXHWYMzLwwMUYULB/EASH2ZCw4xoGAYA/y4OqA==');

if (FindDTM(oneFreeSpin, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Move);

if (WaitUptext('laim', 300)) then
begin
ClickMouse2(mouse_Right);
Wait(RandomRange(100, 200));
ChooseOption('estroy');
Wait(RandomRange(300, 400));
FindNPCChatText('Whatever it says to confirm destroy in here', ClickLeft);
Result := True;
end;
end;



Alright thanks, whenever I get another ticket I'll see what the confirm destroy option says and give that a shot.

iiNveRsioN
04-22-2012, 08:41 AM
I got the another ticket and the confirm is simply a Yes or No. So I went ahead and changed the function to this..

function FindSpinTicket(): Boolean;
var
oneFreeSpin, x, y: Integer;
begin
oneFreeSpin := DTMFromString('mrAAAAHic42BgYMhlYmBIBuJyIC4F4hQgLg PiaiAuAeInQDWvgfg+ED8D4vdQDBK/BcS9BloMHXHWYMzLwwMUYULB/EASH2ZCw4xoGAYA/y4OqA==');

if (FindDTM(oneFreeSpin, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Move);

if (WaitUptext('laim', 300)) then
begin
ClickMouse2(mouse_Right);
Wait(RandomRange(100, 200));
ChooseOption('estroy');
Wait(RandomRange(300, 400));
FindNPCChatText('Yes', ClickLeft);
Result := True;
end;
end;

and get this while compiling:

[Hint] D:\Installed Programs\Simba\Includes\SRL/SRL/core/mapwalk.simba(1353:3): Variable 'BOX' never used at line 1352
[Error] D:\Installed Programs\Simba\Includes\SRL/SRL/core/globalstats.simba(12:34): Identifier expected at line 11
Compiling failed.

Total
04-22-2012, 08:43 AM
Add another end; ?

Imanoobbot
04-22-2012, 08:43 AM
Add another end; ?

Yes, there is another end; needed at the end ^^

*Edit: Oh wrong person. It was already a answer. Just ignore this post.. ;)

iiNveRsioN
04-22-2012, 08:46 AM
Add another end; ?

Lol wow I fail >.>

You are the man. It works perfect. :)

EDIT: When you have two or more tickets, there is a "Destroy All" option, so would I just add another FindNPCChatText after the first with a Destroy All choice in case it ever had two tickets at once?.. Sorry lol I am no good at this purely guessing.

Mat
04-22-2012, 09:17 AM
All in one not sure if it works give it a try :)

function FindSpinTicket(Claim:Boolean): Boolean;
var
oneFreeSpin, x, y: Integer;
begin
oneFreeSpin := DTMFromString('mrAAAAHic42BgYMhlYmBIBuJyIC4F4hQgLg PiaiAuAeInQDWvgfg+ED8D4vdQDBK/BcS9BloMHXHWYMzLwwMUYULB/EASH2ZCw4xoGAYA/y4OqA==');

if (FindDTM(oneFreeSpin, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Move);

if (WaitUptext('laim', 300)) then
begin
If Claim then
begin
ClickMouse2(Mouse_Left);
Result := True;
end else
begin
ClickMouse2(mouse_Right);
WaitOption('troy',300);
Wait(100+Random(200));
FindNPCChatText('Yes', ClickLeft);
Result := True;
end;
end;
end;
end;

Total
04-22-2012, 09:24 AM
When you have two or more tickets, there is a "Destroy All" option, so would I just add another FindNPCChatText after the first with a Destroy All choice in case it ever had two tickets at once?.. Sorry lol I am no good at this purely guessing.

Well, you would have to use ChooseOptionMulti


ChooseOptionMulti(['roy All', 'estroy']);


That way if it finds 'Destroy All' first, it will click it. If not it will find 'Destroy' and click it.

The destroy all option is when you right click yeah?

iiNveRsioN
04-22-2012, 09:44 AM
All in one not sure if it works give it a try :)


hmm what is yours supposed to do exactly? o.O




Well, you would have to use ChooseOptionMulti


ChooseOptionMulti(['roy All', 'estroy']);


That way if it finds 'Destroy All' first, it will click it. If not it will find 'Destroy' and click it.

The destroy all option is when you right click yeah?

I just checked as I just got multiple tickets. It actually adds an 'all' option in addition to the 'Yes' and 'No' in the NPC Chat so no it is not a right click option. The right click option will always be 'estroy'

Total
04-22-2012, 09:50 AM
Then it would be FindNPCChatTextMulti(['All', 'Yes']); or something along those lines. His gives you a choice if you want to destroy it or not, so it would be like FindSpinTicket(True) to use it or FindSpinTicket(False) to destroy it.

Imanoobbot
04-22-2012, 10:01 AM
By the way why you want to destroy them? Isn´t it better just clicking them and gaining the free spin? I mean if you don´t want to roll it just let it be where it is. Don´t get the reason for destroying them.

iiNveRsioN
04-22-2012, 10:07 AM
All in one not sure if it works give it a try :)


Your script gives me this error:




[Hint] D:\Installed Programs\Simba\Includes\SRL/SRL/core/mapwalk.simba(1353:3): Variable 'BOX' never used at line 1352
[Error] D:\Installed Programs\Simba\Includes\SRL/SRL/core/antirandoms/antirandoms.simba(459:19): Invalid number of parameters at line 458




Then it would be FindNPCChatTextMulti(['All', 'Yes']); or something along those lines. His gives you a choice if you want to destroy it or not, so it would be like FindSpinTicket(True) to use it or FindSpinTicket(False) to destroy it.

Awesome. I am now using this and it works with both destroying all tickets and a single ticket:


function FindSpinTicket(): Boolean;
var
oneFreeSpin, x, y: Integer;
begin
oneFreeSpin := DTMFromString('mrAAAAHic42BgYMhlYmBIBuJyIC4F4hQgLg PiaiAuAeInQDWvgfg+ED8D4vdQDBK/BcS9BloMHXHWYMzLwwMUYULB/EASH2ZCw4xoGAYA/y4OqA==');

if (FindDTM(oneFreeSpin, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 5, 5, mouse_Move);

if (WaitUptext('laim', 300)) then
begin
ClickMouse2(mouse_Right);
Wait(RandomRange(100, 200));
ChooseOption('estroy');
Wait(RandomRange(300, 400));
FindNPCChatTextMulti(['All', 'Yes'], ClickLeft);
Result := True;
end;
end;
end;



Thanks again for the help. + rep



By the way why you want to destroy them? Isn´t it better just clicking them and gaining the free spin? I mean if you don´t want to roll it just let it be where it is. Don´t get the reason for destroying them.

Because on f2p accounts you can have a max of 11 free spins and when you reach that it gives you an error, so after you reach that it continues to try to claim spins and an error comes up and screws up all my resource goldfarmers. So, after reaching 11 I have to manually go through every account and use up the spins so the bot can be actually run again without spamming the claim button. It's just to save me a bit of hassle lol.