SRL Archive - Other Scripts

GaiaOnline Slots player


Zigon

2008-06-27 23:07:37

~GaiaOnline Slot Player~
Ver.1
~By: Zygaun~


Description: Automatically plays for you, you can set how many tokens you want to bet at a time and how many you many tokens to use in total. After you've stopped the script(with "q" or once you've used up all of your tokens) it will give you a detailed progress report.

I don't plan on updating this script ever, but some form of feedback would be appreciated.
This is my 2nd script ever so be nice Tongue

{
Set up lines 13 to 15, make sure the Slots window is in view.

HOTKEYS:
q = Quit
p = Show progress report

}

program SlotPlayer;

const
CON_TOKENS=3; //Number of tokens to bet: 1,2 or 3
CON_HowManyTokens=250; //How many tokens are you betting?
CON_PlayWithTokens=true; //Set to false to play with winnings


var
x,y,z,blnCounter,s,e:integer;
TotalSpins:Integer;
strTotalSpins:string;
intSpent:Integer;
strSpent:String;
blnQuit:Boolean;
strItemName:String;

//check what you won booleans
FirstDemon,SecondDemon,ThirdDemon:Boolean;
FirstWing,SecondWing,ThirdWing:Boolean;
FirstGold,SecondGold,ThirdGold:Boolean;
FirstGift,SecondGift,ThirdGift:Boolean;
FirstHalo,SecondHalo,ThirdHalo:Boolean;


//Winnings integers
int2Match:integer;
int2Demon, intAllDemon:Integer;
int2Wing, intAllWing:Integer;
int2Gold, intAllGold:Integer;
int2Gift, intAllGift:Integer;
int2Halo, intAllHalo:Integer;

//Winnings Strings
str2Match:String;
str2Demon, strAllDemon:String;
str2Wing, strAllWing:String;
str2Gold, strAllGold:String;
str2Gift, strAllGift:String;
str2Halo, strAllHalo:String;



procedure spin;
begin
x:=479;
y:=455;
z:=1;
movemousesmooth(x,y);
clickmouse(x,y,true);
TotalSpins:=TotalSpins + 1
end;

procedure PlayToken;
Begin
z:=1;
x:=225;
y:=453;
movemousesmooth(x,y);
while z <= CON_TOKENS do
Begin
clickmouse(x,y,true);
z:=z +1;
wait(150);
//writeln('pressed');
End;
end;

procedure playWinnings;
Begin
x:=345;
y:=453;
movemousesmooth(x,y);
while z <= CON_TOKENS do
Begin
clickmouse(x,y,true);
z:=z +1;
wait(150);
//writeln('pressed');
End;
end;


Procedure CheckWins;
var
fx1,fy1,sx11,sy11,fx2,fy2,sx22,sy22,fx3,fy3,sx33,sy33:integer;
intItem,e,r:integer;
blnFirstItem,blnSecondItem,blnThirdItem:Boolean;

Begin

intItem:=0;
r:=0;

//First Column
fx1:=229;
fy1:=323;
sx11:=278;
sy11:=365;
//Second Column
fx2:=293;
fy2:=299;
sx22:=344;
sy22:=392;
//Third Column
fx3:=358;
fy3:=303;
sx33:=398;
sy33:=388;

////////////////////Devil//////////////////////////
if findcolor(x,y,8277731,fx1,fy1,sx11,sy11) then
Begin
//Writeln('found devel in first column');
FirstDemon:=True;
End;

if findcolor(x,y,5777100,fx2,fy2,sx22,sy22) then
Begin
//Writeln('found devel in middle column');
SecondDemon:=True;
End;

if findcolor(x,y,6039254,fx3,fy3,sx33,sy33) then
Begin
//Writeln('found devel in last column');
ThirdDemon:=True;
End;




////////////////////Gold///////////////////
if findcolor(x,y,5755376,fx1,fy1,sx11,sy11) then
Begin
//Writeln('found gold in first column');
FirstGold:=True;
End;

if findcolor(x,y,5684189,fx2,fy2,sx22,sy22) then
Begin
//Writeln('found gold in middle column');
SecondGold:=True;
End;

if findcolor(x,y,1420253,fx3,fy3,sx33,sy33) then
Begin
//Writeln('found gold in last column');
ThirdGold:=True;
End;




////////////////////Wing//////////////////
if findcolor(x,y,14978889,fx1,fy1,sx11,sy11) then
Begin
//Writeln('found wing in first column');
FirstWing:=True;
End;

if findcolor(x,y,15113311,fx2,fy2,sx22,sy22) then
Begin
//Writeln('found wing in middle column');
SecondWing:=True;
End;

if findcolor(x,y,15313269,fx3,fy3,sx33,sy33) then
Begin
//Writeln('found wing in last column');
ThirdWing:=True;
End;




////////////////////Gift//////////////////
if findcolor(x,y,9713686,fx1,fy1,sx11,sy11) then
Begin
//Writeln('found gift in first column');
FirstGift:=true;
End;

if findcolor(x,y,14584163,fx2,fy2,sx22,sy22) then
Begin
//Writeln('found gift in middle column');
SecondGift:=true;
End;

if findcolor(x,y,9977114,fx3,fy3,sx33,sy33) then
Begin
//Writeln('found gift in last column');
ThirdGift:=true;
End;




////////////////////Halo//////////////////////
if findcolor(x,y,15859454,fx1,fy1,sx11,sy11) then
Begin
//Writeln('found halo in first column');
FirstHalo:=true;
End;

if findcolor(x,y,14941950,fx2,fy2,sx22,sy22) then
Begin
//Writeln('found halo in middle column');
SecondHalo:=true;
End;

if findcolor(x,y,7339261,fx3,fy3,sx33,sy33) then
Begin
//Writeln('found halo in last column');
ThirdHalo:=true;
End;




While (e <=5 ) do
Begin


case e of
0:
Begin
blnFirstItem:=FirstDemon;
blnSecondItem:=SecondDemon;
blnThirdItem:=ThirdDemon;
//Writeln('checking demon');
strItemName:='Demons';
End;
1:
Begin
blnFirstItem:=FirstGold;
blnSecondItem:=SecondGold;
blnThirdItem:=ThirdGold;
//Writeln('checking gold');
strItemName:='Gold';
End;
2:
Begin
blnFirstItem:=FirstGift;
blnSecondItem:=SecondGift;
blnThirdItem:=ThirdGift;
//Writeln('checking gift');
strItemName:='Gifts';
End;
3:
Begin
blnFirstItem:=FirstWing;
blnSecondItem:=SecondWing;
blnThirdItem:=ThirdWing;
//Writeln('checking wing');
strItemName:='Wings';
End;
4:
Begin
blnFirstItem:=FirstHalo;
blnSecondItem:=SecondHalo;
blnThirdItem:=ThirdHalo;
//Writeln('checking halo');
strItemName:='Halos';
End;

End; //ends case e


If ((blnFirstItem=true) and (blnSecondItem=True) and (blnThirdItem=True)) then
Begin
//Writeln('Found full line of ' + strItemName);
intAllDemon:=intAllDemon+1;
blnFirstItem:=false;
blnSecondItem:=false;
blnThirdItem:=false;

case e of
0:
Begin
intAllDemon:=intAllDemon+1;
End;
1:
Begin
intAllGold:=intAllGold+1;
End;
2:
Begin
intAllGift:=intAllGift+1;
End;
3:
Begin
intAllWing:=intAllWing+1;
End;
4:
Begin
intAllHalo:=intAllHalo+1;
End;

End; // end case
End;

If (((blnFirstItem=true) and(blnSecondItem=True)) or ((blnSecondItem=True) and (blnThirdItem=true))) then
Begin
//Writeln('Found 2 ' + strItemname + ' Together');
int2Demon:=int2Demon+1;
blnFirstItem:=false;
blnSecondItem:=false;
blnThirdItem:=false;


case e of
0:
Begin
int2Demon:=int2Demon+1;
End;
1:
Begin
int2Gold:=int2Gold+1;
End;
2:
Begin
int2Gift:=int2Gift+1;
End;
3:
Begin
int2Wing:=int2Wing+1;
End;
4:
Begin
int2Halo:=int2Halo+1;
End;

End; // end case

End;


e:=e+1;

End; //ends the while..do

End; // end CheckWins





Procedure ProgressReport;
begin
Case CON_TOKENS of
1:intSpent:=TotalSpins * CON_TOKENS;
2:intSpent:=TotalSpins * CON_TOKENS;
3:intSpent:=TotalSpins * CON_TOKENS;
End;

strTotalSpins:= inttostr(TotalSpins);
strSpent:= inttostr(intSpent);

str2Demon:= inttostr(int2Demon)
strAllDemon:= inttostr(intAllDemon)
str2Wing:= inttostr(int2Wing)
strAllWing:= inttostr(intAllWing)
str2Gold:= inttostr(int2Gold)
strAllGold:= inttostr(intAllGold)
str2Gift:= inttostr(int2Gift)
strAllGift:= inttostr(intAllGift)
str2Halo:= inttostr(int2Halo)
strAllHalo:= inttostr(intAllHalo)

int2match:=int2Demon + int2Wing +int2Gift + int2Gold + int2Halo;
str2Match:= inttostr(int2Match);
Writeln('');
Writeln(' ~GaiaOnline Slot Player~ ');
Writeln(' Ver.1 ');
Writeln(' ~By: Zygaun~ ');
Writeln('');
Writeln('Detailed Progress Report:');
Writeln('Coins Spent: ' + strSpent);
Writeln('Played Games: ' + strTotalSpins);
Writeln('');
Writeln('2 Match Wins: ' + str2Match);
Writeln('');
Writeln('Full Line Wins');
Writeln('Gold: '+strAllGold);
Writeln('Demon: '+strAllDemon);
Writeln('Gift: '+strAllGift);
Writeln('Wing: '+strAllWing);
Writeln('Halo: '+strAllHalo);
Writeln('');


end;


Procedure StopPlaying;
Begin
if (iskeydown('q')) or (intSpent=CON_HowManyTokens) then
Begin
blnQuit:=true;
writeln('Stopping...');
End;
End;

Begin
ClearDebug;
blnQuit:=false;
TotalSpins:=0;
blnCounter:=1;
s:=1;
e:=0;
repeat
StopPlaying;
e:=0;
s:=1;
blnCounter:=1;
while s <=15 do
Begin
case blnCounter of
1: FirstDemon:=false;
2: SecondDemon:=false;
3: ThirdDemon:=false;
4: FirstWing:=false;
5: SecondWing:=false;
6: ThirdWing:=false;
7: FirstGold:=false;
8: SecondGold:=false;
9: ThirdGold:=false;
10: FirstGift:=false;
11: SecondGift:=false;
12: ThirdGift:=false;
13: FirstHalo:=false;
14: SecondHalo:=false;
15: ThirdHalo:=false;
End; //end case
s:=s+1;
blnCounter:=blnCounter + 1;
//test:=inttostr(s);
//writeln(test);
End; // end while loop




if (CON_PlayWithTokens=true) then
Begin
PlayToken;
StopPlaying;
End else
Begin
PlayWinnings;
StopPlaying;
End;

wait(100);
Spin;
StopPlaying;
wait(6500);
StopPlaying;
CheckWins;

Case CON_TOKENS of
1:intSpent:=TotalSpins * CON_TOKENS;
2:intSpent:=TotalSpins * CON_TOKENS;
3:intSpent:=TotalSpins * CON_TOKENS;
End;
StopPlaying;
//until(iskeydown('q'));

if (iskeydown('p')) then
Begin
ProgressReport
End;

until (blnQuit);

ProgressReport;


end.

Wanted

2008-06-28 23:05:04

Thank you for making this, I hate Gaia-Online. Anything to mess them up is good.:stirthepot: :f:

PhantomCode

2008-06-28 23:14:07

Hmm… You need to work on your standards.
There a rules for where to put spaces etc.
I recommend you read a tut and bring your script up to SRL-Forums standard.

Here are the SCAR Script Official Standards (thanks to Bam Bam):
http://www.villavu.com/forum/showthread.php?t=3293

Zigon

2008-06-30 04:35:33

I know about proper indentation and everything, but by the time I started working on this I was tired and still asking myself why I was on GaiaOnline. But yeah, it's pretty messy.

Laur€ns

2008-07-02 06:39:32

It works so I don't mind :D

GoF

2008-07-02 07:24:55

Indenting just makes it easier to read. Not that much of a difference tbh (unless the standards are really horrible), but it's become a habit to complain to anyone about the standards if there's has a mistake somewhere :p

I don't even know what GaiaOnline is.. Google time.