SRL Archive - Archive

marpis - SRL Member Application Form


marpis

2009-03-05 11:08:17

<!– BEGIN TEMPLATE: formanswers –>
marpis - SRL Member Application Form
marpis

What is the meaning to life?


Where you Referred to SRL? If yes, by whom?
no


Programming Knowledge
HTML

Other Communitys
muusikoiden.net (finnish musicians), nothing useful rly

How Long have You Played Runescape
in my life, maybe 4 years? i started again last fall (2008)

Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.

Well, i didn't get in last time so now i try again with a better script :)
I am 18 years old, Finnish, and programming is pretty much everything i do when im at my computer. What to say? Im mature, quick learner, i like to help others.

——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted

I know, it doesn't have radialwalk. But honestly its the easiest thing. dunno why its so essential. I can make a walker script if needed ^^

program ChopAndBurn;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/WoodCutting.scar}
const
{ Chop&Burn - Woodcutter & Firemaker - by marpis.
( version: 3.1 )

Contact me on forums via private message.
You can use my functions and/or procedures, BUT REMEMBER TO CREDIT!
Feel free to edit this script.

DO NOT USE WITHOUT POSTING A PROGGY OR ERROR RAPORT TO THIS THREAD:
....

Note that Specific report is not 100% accurate!

__________________________________
} // I M P O R T A N T \\
// {}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-={}
// {} {}
// {} Remember to have the {}
// {} TINDERBOX IN THE 1st INV SLOT {}
// {} if you are burning the logs {}
// {} {}
// {}=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-={}

// SRL-Stats
YourSrlID = '';
YourSrlPW = '';

// Script Setup
breakafterminutes = 45; //take a 15-minute break every x minutes


//////////////////DECLARE PLAYERS////////////////
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
numberOfPlayers(howManyPlayers);
CurrentPlayer := 0;

// Max wood to burn/drop is 999.

Players[0].Name := ''; //username
Players[0].Pass := ''; //password
Players[0].Nick := ''; //3-4 letters from your username
Players[0].integers[0]:= 2; //How many loads to do before switching players?
Players[0].integers[1]:= 999; //How many logs you want to burn/drop
Players[0].strings[1]:='N'; //Direction to flee a fight
Players[0].booleans[1]:= true; //Burn logs? if false, drop logs
Players[0].Active := true;
{
Players[1].Name := ''; //username
Players[1].Pass := ''; //password
Players[1].Nick := ''; //3-4 letters from your username
Players[1].integers[0]:= 2; //How many loads to do before switching players
Players[1].integers[1]:= 999; //How many logs you want to burn/drop
Players[1].strings[1]:='N'; //Direction to flee a fight
Players[1].booleans[1]:= true; //Burn logs? if false, drop logs
Players[1].Active := True;
{
Players[2].Name := ''; //username
Players[2].Pass := ''; //password
Players[2].Nick := ''; //3-4 letters from your username
Players[2].integers[0]:= 2; //How many loads to do before switching players
Players[2].integers[1]:= 999; //How many logs you want to burn/drop
Players[2].strings[1]:='N'; //Direction to flee a fight
Players[2].booleans[1]:= true; //Burn logs? if false, drop logs
Players[2].Active := true;
{
Players[3].Name := ''; //username
Players[3].Pass := ''; //password
Players[3].Nick := ''; //3-4 letters from your username
Players[3].integers[0]:= 2; //How many loads to do before switching players
Players[3].integers[1]:= 100; //How many logs you want to burn/drop
Players[3].strings[1]:='N' //Direction to flee a fight
Players[3].booleans[1]:= true; //Burn logs? if false, drop logs
Players[3].Active := true;
{
Players[4].Name := ''; //username
Players[4].Pass := ''; //password
Players[4].Nick := ''; //3-4 letters from your username
Players[4].integers[0]:= 2; //How many loads to do before switching players
Players[4].integers[1]:= 100; //How many logs you want to burn/drop
Players[4].strings[1]:='N' //Direction to flee a fight
Players[4].booleans[1]:= true; //Burn logs? if false, drop logs
Players[4].Active := True;
}

end;

////////////////////VARIABLES/////////////////////
// players[x].integers[2] = How many loads player has done
// players[x].integers[3] = How many logs player has burned/dropped
var
regularlog, timemark, x, y, x3, y3, failed, i2, i, timefromclickinglog, MajorMark, cmark, BurnTries : integer;
TreesToChop, LogsToBurn : Array of string;
didweburn : boolean;
////////////////////////////////////////////////
/////////////////////////////SETUP PLAYER//////
Procedure Setupplayer;
var
CurrentExp: integer;
begin
writeln('Waiting RS to load.');
wait(1000);
repeat
wait(1000);
until(GetColor(MSCX, MSCY) <> 0);
wait(2000);
{-----------------------}
if (players[currentplayer].booleans[1] = true) then
begin
CurrentExp := GetXP('firemaking');
case CurrentExp of
-1..2411: LogsToBurn := ['Logs'];
2412..13362: LogsToBurn := ['Logs','Oak'];
13363..273742: LogsToBurn := ['Logs', 'Oak', 'Willow'];
273742..999999999: LogsToBurn := ['Logs','Oak','Willow','Yew'];
end;
i := GetArrayLength(LogsToBurn);
case i of
0: begin
writeln('SOMETHINGS WRONG! Terminating...');
terminatescript;
end;
1: writeln('* Logs to burn: Regular logs');
2: writeln('* Logs to burn: Regular logs, Oak logs');
3: writeln('* Logs to burn: Regular logs, Oak logs, Willow logs');
4: writeln('* Logs to burn: Regular logs, Oak logs, Yew logs');
end;
end else writeln('* All logs will be dropped');
{-----------------------}
CurrentExp := GetXP('woodcutting');
case CurrentExp of
-1..2411: TreesToChop := ['Tree'];
2412..13362: TreesToChop := ['Tree','Oak'];
13363..273742: TreesToChop := ['Tree','Oak','Willow'];
273742..999999999: TreesToChop := ['Tree','Oak','Yew','Willow'];
end;
i := GetArrayLength(TreesToChop);
case i of
0: begin
writeln('SOMETHINGS WRONG! Terminating...');
terminatescript;
end;
1: writeln('* Trees to chop: Regular Trees.');
2: writeln('* Trees to chop: Regular Trees, Oaks');
3: writeln('* Trees to chop: Regular Trees, Oaks, Willows');
4: writeln('* Trees to chop: Regular Trees, Oaks, Willows, Yews');
end;
{-----------------------}
failed := 0;
SetAngle(true);
wait(50);
KeyDown(VK_DOWN);
wait(700+random(30));
KeyUp(VK_DOWN);
if not FindColorTolerance(x, y, 1123377, 60, 480, 115, 500, 10) then Mouse(90, 490, 25, 10, true);
wait(500+random(200));
GameTab(4);
end;
//////////////////////////////////////
///////////InCloseCombat by EvilChicken
function InCloseCombat: Boolean;
var
G, R: TPointArray;
begin
FindColorsTolerance(G, 65280, 203, 85, 300, 172, 0);
FindColorsTolerance(R, 255, 203, 85, 300, 172, 0);
Result := High(CombineTPA(G, R)) > 10;
end;
////////////////////////////////////////////////
function FindTinderbox : boolean;
var
x2, y2, tbox: integer;
Box: TBox;
begin
tbox := DTMFromString('78DA8DD2BD0A80300C04E014F1B5D541B05A5' +
'48ABF8388FAA27ABA4851B86448960F42C2191F8958236119899F' +
'2E72A24C03537ECDDB312D8C232683698949603A8599894961166' +
'272989D9812E620E6FECF464C07B312332BEE9A6006C52E4FCC08' +
'5313D3FF6723305E615A457E1C4C454CC13376012D6C1AE8');
Box:= InvBox(1);
case FindDtm(tbox, x2, y2, Box.x1, Box.y1, Box.x2, Box.y2) of
true: Result := true;
false: begin
GameTab(4);
wait(200+random(100));
result := FindDtm(tbox, x2, y2, Box.x1-5, Box.y1-5, Box.x2+5, Box.y2+5);
end;
end;
FreeDtm(tbox);
end;
///////////////////////////////////////////////
procedure AntiRandom;
begin
if not loggedin then exit;
findnormalrandoms;
if InCloseCombat then
runaway(Players[currentplayer].strings[1], true, 1, 30000+random(5000));
end;
////////////////////////////////////////////////
///////////////////////RAPORT///////////////////
procedure Raport;
var timetobreak, i : integer;
begin
ClearDebug;
timetobreak := breakafterminutes - ( TimeFromMark(timemark) / 1000 /60 );
writeln('*****************************************************************');
for i := 0 to HowManyPlayers-1 do
begin
if ( CurrentPlayer = i ) then
begin
writeln('| '+padr(Players[i].Nick, 4)+' : '+padr(intToStr(players[i].integers[3]), 3)+' logs of '+padr(IntToStr(Players[i].Integers[1]), 3)+' | Active: '+padr(booltostr(Players[i].Active), 5)+' | !CURRENTLY PLAYING! |');
end else
begin
writeln('| '+padr(Players[i].Nick, 4)+' : '+padr(intToStr(players[i].integers[3]), 3)+' logs of '+padr(IntToStr(Players[i].Integers[1]), 3)+' | Active: '+padr(booltostr(Players[i].Active), 5)+' | '+padr(players[i].Loc, 22)+'|');
end;
end;
writeln('*****************************************************************');
writeln(padr('| Script worked for '+TimeRunning, 65)+'|');
writeln('*****************************************************************');
writeln('| Script by: marpis |');
writeln('*****************************************************************');
SrlRandomsReport;
ClearReport;
AddToReport('Specific Report');
for i:= 0 to HowManyPlayers-1 do
begin
AddToReport(''+Capitalize(players[i].name));
AddToReport(' [ Trees: '+padl(IntToStr(players[i].integers[5]), 7)+' ]');
AddToReport(' [ Oaks: '+padl(IntToStr(players[i].integers[6]), 8)+' ]');
AddToReport(' [ Willows: '+padl(IntToStr(players[i].integers[4]), 5)+' ]');
AddToReport(' [ Yews: '+padl(IntToStr(players[i].integers[7]), 8)+' ]');
AddToReport(' Xp Gained: '+floattostr(players[i].integers[5]*25 + players[i].integers[6]*37.5 + players[i].integers[4]*67.5 + players[i].integers[7]*175));
AddToReport('');
end;

end;
//////////////////////////////////////////////////

Procedure ScriptTerminate;
begin
// Raport;
FreeDTM(regularlog);
end;
/////////////////////////////////////////////////
//////////////////////HAVE A BREAK //////////////
procedure HaveABreak;
var time: integer;
begin
status('sleeping');
if loggedin then logout;
writeln('having a few minutes break (14min + random 2min)');
time:=1000*60*14+random(1000*60*2);
repeat
Disguise('Break remaining: '+inttostr(time / 60000)+' min');
time:= time - 1000;
wait(1000);
until(time < 1000);
writeln('ok then, lets continue!');
Disguise('runescape.com');
loginplayer;
end;
/////////////////////////////////
function AxeBroken : boolean;
begin
result := FindBlackChatMessage('ou do not');
end;
///////////////////////////////////////////////
function EndMainloop : boolean;
var q: integer;
begin
Result := False;
for q := 0 to 6 do
begin
case q of
0: Result := AxeBroken;
2: Result := failed > 6;
3: Result := (players[currentplayer].integers[2] >= players[currentplayer].integers[0]) and (players[currentplayer].integers[3] > 0);
4: Result := LoggedIn = false;
5: Result := players[currentplayer].integers[3] >= players[currentplayer].integers[1];
6: Result := BurnTries > 6;
end;
if Result then
begin
players[currentplayer].integers[2]:= 0;//set loads to 0
case q of
0:begin
players[currentplayer].Loc:= 'All axes broken';
NextPlayer(false);
end;
2:begin
players[currentplayer].Loc:= 'Couldnt find a tree';
NextPlayer(false);
end;
3:NextPlayer(true);
4:begin
players[currentplayer].Loc:= 'Player logged out';
NextPlayer(false);
end;
5:begin
players[currentplayer].Loc:= 'Player done!';
NextPlayer(false);
end;
6:begin
players[currentplayer].loc:= 'Lost while burning';
Burntries := 0;
NextPlayer(false);
end;
end;
Raport;
wait(100);
SetupPlayer;
exit;
end;
end;
end;
////////////////LOAD DTMS//////////////////////
Procedure LoadDTM;
begin
RegularLog := DTMFromString('78DA8DCFC10A82601004E0FD839E280F295E2' +
'C24440D7D7C43093C58A2113E410E5E049166E6307BF958769D7F' +
'30AB6D1367C7A5CD7E888BF6CDDA9857C1C4300F626E301531A96' +
'0329886981CE62998969812E625989E98026620E60E331293C07C' +
'88B9C07C89096126620261CF59B8C713FE3AC1BC05D3FD37330C9' +
'21CC0');
end;

////////////////////////////////////////////////
//////////////////////DO RANDOM STUFF///////////
procedure DoRandomStuff;
begin
case(random(13)) of
0: HoverSkill('random', false);
1: begin
wait(100+random(100));
GameTab(1 +random(7));
wait(100+random(100));
GameTab(4);
end;
2: RandomMovement;
3,4: SleepAndMoveMouse(1000+random(3500));
5,6,7: if FindColorTolerance(x, y, 7556434, 120, 480, 170, 500, 10) then
begin
Mouse(150, 490, 22, 8, true);
SleepAndMoveMouse(2500+random(1000));
FindMod;
Mouse(90, 490, 22, 8, true);
end;
8,9: PickupMouse;
end;
GameTab(4);
end;

///////////////////////////////////////////////
////////////////////AVOID FIRE/////////////////

Procedure AvoidFire;
begin
status('Moving from fire...');
case random(4) of
0:Mouse(MMCX, MMCY+8, 2, 2, TRUE);
1:Mouse(MMCX+8, MMCY, 2, 2, TRUE);
2:Mouse(MMCX, MMCY-8, 2, 2, TRUE);
3:Mouse(MMCX-8, MMCY, 2, 2, TRUE);
end;
While FlagPresent do AntiRandom;
end;

function StandOnFire: boolean;
var c1, c2, c3: tpointarray;
begin
FindColorsTolerance(c1, 1734844, 207, 172, 282, 212, 35);
FindColorsTolerance(c2, 2128827, 207, 172, 282, 212, 35);
FindColorsTolerance(c3, 2339567, 207, 172, 282, 212, 35);
Result:= High(CombineTPA(CombineTPA(c1, c2), c3))>10;
end;

////////////////////////////////////////////////
//////////////////////Stop burning/////////////
function StopBurning: Boolean;
var q: integer;
begin
Result := False;
if not LoggedIn then exit;
for q := 0 to 5 do
begin
case q of
0: Result := timefrommark(TimeFromClickingLog) > 15000;
1: Result := FindChatBoxText('he fire catches', 8, 0);
2: Result := FindChatBoxText('ou can', 8, 0);
3: Result := FindText(x, y, 'Congratulation', NPCChars, MCX1, MCY1, MCX2, MCY2);
4: Result := InCloseCombat;
5: Result := FindNormalRandoms;
end;
if Result then
begin
status('Logs burned!');
exit;
end;
end;
end;

/////////////////////////////////////////////
function Burn: boolean;
begin
if not FindDTM(RegularLog, x, y, MIX1, MIY1, MIX2, MIY2) then
didweburn := true;
if not FindTinderbox then
begin
players[currentplayer].booleans[1] := false;
writeln('TinderBox not found: Player will drop logs');
exit;
end;
MMouse(x, y, 2, 2);
wait(200+random(50));
If IsUpTextMultiCustom(LogsToBurn) then
begin
case copy(GetUpText, 5, 3) of
'Wil': Inc(players[CurrentPlayer].integers[4]);
'Log': Inc(players[CurrentPlayer].integers[5]);
'Oak': Inc(players[CurrentPlayer].integers[6]);
'Yew': Inc(players[CurrentPlayer].integers[7]);
end;
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
wait(200+random(50));
MouseItem(1, true);
Ftwait(3);
MarkTime(TimeFromClickingLog);
status('Burning logs...');
repeat
AntiRandom
wait(10);
until(StopBurning);
if FindChatBoxText('he fire', 8, 0) or FindText(x, y, 'Congratulation', NPCChars, MCX1, MCY1, MCX2, MCY2) then
begin
Result := true;
Inc(players[currentplayer].integers[3]);
ReportVars[0] := ReportVars[0] + 1;
exit;
end;
if FindChatBoxText('ou can', 8, 0) then
Result := false;
end else
begin
status('Dropping logs...');
GetMousePos(x, y);
wait(100+random(50));
case copy(GetUpText, 5, 3) of
'Wil': Inc(players[CurrentPlayer].integers[4]);
'Log': Inc(players[CurrentPlayer].integers[5]);
'Oak': Inc(players[CurrentPlayer].integers[6]);
'Yew': Inc(players[CurrentPlayer].integers[7]);
end;
Mouse(x, y, 0, 0, false);
wait(200+random(50));
Result := ChooseOption('Drop');
wait(1200+random(100));
Inc(players[currentplayer].integers[3]);
ReportVars[0] := ReportVars[0] + 1;
end;
end;
////////////////////////////////////////////////
///////////////////////BURN WOOD///////////////
procedure BurnDrop;
begin
if not loggedin then exit;
if not InvFull then exit;
GameTab(4);
AntiRandom;
FixChat;
repeat
if FindDTM(RegularLog, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
if StandOnFire then avoidfire;
case players[currentplayer].booleans[1] of
true:
begin
repeat
if Burn then
begin
didweburn := true;
BurnTries := 0;
end else
begin
didweburn := false;
avoidfire;
Inc(burntries);
writeln('Firemaking failed: '+inttostr(burntries));
end;
until(didweburn or (BurnTries > 6));
end;
false:
begin
MMouse(x, y, 2, 2);
wait(300+random(100));
case copy(GetUpText, 5, 3) of
'Wil': Inc(players[CurrentPlayer].integers[4]);
'Log': Inc(players[CurrentPlayer].integers[5]);
'Oak': Inc(players[CurrentPlayer].integers[6]);
'Yew': Inc(players[CurrentPlayer].integers[7]);
end;
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
wait(200+random(50));
status('Dropping logs...');
ChooseOption('Drop');
Inc(players[currentplayer].integers[3]);
ReportVars[0] := ReportVars[0] + 1;
wait(2000+random(50));
end;
end;
end;
until(not FindDTM(RegularLog, x, y, MIX1, MIY1, MIX2, MIY2) or endmainloop);
Inc(players[CurrentPlayer].integers[2]);
end;

////////////////////////////////////////////////
//////////////FIND TREE///////////////////////////
function FindTree: boolean;
var
i, x, y, mark: integer;
TPA, c1, c2, c3, c4 : TPointArray;
Trees: Array of TPointArray;
begin
Result:= false;
FindColorsSpiralTolerance(MSCX, MSCY, c1, 7254949, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(MSCX, MSCY, c2, 132099, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(MSCX, MSCY, c3, 2706234, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(MSCX, MSCY, c4, 1387555, MSX1, MSY1, MSX2, MSY2, 5);
TPA := CombineTPA(CombineTPA(c1, c2), CombineTPA(c3, c4));
Trees:= SplitTPA(TPA, 5);
if (GetArrayLength(Trees) < 1) then
exit;
MarkTime(mark);
for i:= 0 to high(Trees) do
begin
if (TimeFromMark(mark) > 3000) then exit;
if MiddleTPAEx(Trees[i], x, y) then
begin
MMouse(x, y, 6, 6);
FTWait(2);
Result:= IsUpTextMultiCustom(TreesToChop);
if result then exit;
end;
end;
end;


////////////////////////////////////////////////
////////////////////////STOP HACKING //////////
function StopHacking: Boolean;
var q : integer;
begin
Result := False;
if not LoggedIn then exit;
for q := 0 to 7 do
begin
case q of
0: Result := AxeBroken;
1: Result := FindEnt(x3, y3, true);
2: Result := TimeFromMark(cmark) > 15000;
3: Result := i2 > i;
4: Result := InCloseCombat;
5: Result := FindNormalRandoms;
6: Result := InvFull;
7: Result := FindText(x, y, 'Guard', NPCChars, MCX1, MCY1, MCX2, MCY2);
end;
if Result then
begin
if q=7 then
RunTo('s', true);
exit;
end;
end;
end;


////////////////////////////////////////////////
///////////////////////////CHOP////////////////
procedure Chop;
var q : integer;
begin
if not loggedin then exit;
AntiRandom;
GetMousePos(x3, y3);
mouse(x3, y3, 2, 2, false);
wait(400+random(100));
if ChooseOption('hop') then
begin
failed := 0;
i := InvCount;
Flag;
wait(1000+random(100));
FindTree;
wait(1000);
status('Chopping...');
MarkTime(cmark);
repeat
wait(10);
i2 := InvCount;
AntiRandom;
until(StopHacking);
end;
AntiRandom;
GameTab(4);
end;
////////////////////////////////////////////////
///////////////////////////LOOK FOR A TREE/////
procedure LookForTree;
begin
repeat
if not loggedin then exit;
AntiRandom;
status('Tree not found!');
Inc(failed);
writeln('failed: '+inttostr(failed));
SetAngle(true);
case random(4) of
0: MakeCompass(IntToStr(60+random(40)));
1: MakeCompass(IntToStr(150+random(40)));
2: MakeCompass(IntToStr(240+random(40)));
3: MakeCompass(IntToStr(330+random(40)));
end;
sleepandmovemouse(3000+random(1000));
until(FindTree or (failed > 6) );
if FindTree then Chop;
SetAngle(true);
KeyDown(VK_DOWN);
wait(700+random(30));
KeyUp(VK_DOWN);
GameTab(4);
end;

procedure Signature;
begin
ClearDebug;
writeln(' __ __ _');
writeln(' / |_ _ _ | )| || )|\ |');
writeln(' \__ | ||_||_| & |_ )|_|| \| \|');
writeln(' |');
wait(2000);
ReplaceDebugline(3, ' | b');
wait(100);
ReplaceDebugline(3, ' | by ');
wait(100);
ReplaceDebugline(3, ' | by: ');
wait(100);
ReplaceDebugline(3, ' | by: m');
wait(100);
ReplaceDebugline(3, ' | by: ma');
wait(100);
ReplaceDebugline(3, ' | by: mar');
wait(100);
ReplaceDebugline(3, ' | by: marp');
wait(100);
ReplaceDebugline(3, ' | by: marpi');
wait(100);
ReplaceDebugline(3, ' | by: marpis');
writeln('');
wait(2000);
end;
////////////////////////////////////////////////
//////////////////////MAIN EXECUTION///////////
begin
Signature;
SetupSrl;
if (YourSrlID <> '') then SRLID := YourSrlID;
if (YourSrlPW <> '') then SRLPassword := YourSrlPW;
DeclarePlayers;
Disguise('runescape.com');
ScriptID := '1163';
LoadDTM;
ActivateClient;
if not loggedin then loginplayer;
SetupPlayer;
repeat
MarkTime(MajorMark);
repeat
if InvFull then
begin
BurnDrop;
Raport;
end;
repeat
DoRandomStuff;
if FindTree then Chop
else LookForTree;
until(InvFull or endmainloop);
BurnDrop;
Raport;
if endmainloop then writeln('~ STARTING WITH NEW PLAYER! ~');
until(TimeFromMark(MajorMark) >= 1000*60*breakafterminutes);
HaveABreak;
until(AllPlayersInactive);
TerminateScript;
end.

——————————————————
<!– END TEMPLATE: formanswers –>

Dervish

2009-03-05 11:12:30

You won't break your axe anymore, you should delete that from StopBurning ;).

Standards off here and there…

I'm too tired to read too closely but I'll vote yes.

Grade : 70/100.

marpis

2009-03-05 14:43:34

Oh the ent update came? ^^ great!
And whoever voted No, i'd love to read your argumentations :)

NCDS

2009-03-05 15:03:25

Your Standards are somewhat annoying to read, but I do really like you use of 'case'.

Unfortunately 'case' is not all we vote on and at this point im not impressed enough to say yes right away.

Ill hold my vote for a while and look through the script closer.

Good Luck

Sir R. M8gic1an

2009-03-05 15:39:33

From: Quickmarch
Nice script yes from me. One thing though, in your FindTree function you could change


FindColorsSpiralTolerance(MSCX, MSCY, c1, 7254949, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(MSCX, MSCY, c2, 132099, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(MSCX, MSCY, c3, 2706234, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(MSCX, MSCY, c4, 1387555, MSX1, MSY1, MSX2, MSY2, 5);
TPA := CombineTPA(CombineTPA(c1, c2), CombineTPA(c3, c4));

to


var
i: Integer;
Colours: TIntegerArray;

begin
Colours := [Tree colours here];
for i := 0 to Length(Colours) - 1 do
begin
FindColorsSpiralTolerance(MSCX, MSCY, c4, Colours[i], MSX1, MSY1, MSX2, MSY2, 5);
etc.

:)


wrong. read better, especially concerning the tpa to which it is saved to. remember that each time that you call FindColorsSpiralTolerance with a tpa the tpa will be reset and the new values added to it.

edit: QuickMarch was happier to delete his post rather than be corrected. oh well, it's quoted here anyway and whoever wishes to, might read and figure out the mistake.

~RM

WT-Fakawi

2009-03-05 16:40:39

Had a good read. Nice coding.

weequ

2009-03-06 04:45:39

Yes :)

MasterKill

2009-03-06 05:23:03

Looks very nice, yes from me :)

One hint:

If you only have 1 line, after an if, you can remove the begin and and:
If EatCookies Then
Cookie := Cookie + 1;

and if you have an else:

If EatCookies Then
Cookie := Cookie + 1
Else
NoCookie := NoCookie + 1;

^ note that there is no ";" between the Then and Else

I also made an example for in you script:

  for i := 0 to HowManyPlayers-1 do
if ( CurrentPlayer = i ) then
writeln('| '+padr(Players[i].Nick, 4)+' : '+padr(intToStr(players[i].integers[3]), 3)+' logs of '+padr(IntToStr(Players[i].Integers[1]), 3)+' | Active: '+padr(booltostr(Players[i].Active), 5)+' | !CURRENTLY PLAYING! |')
else
writeln('| '+padr(Players[i].Nick, 4)+' : '+padr(intToStr(players[i].integers[3]), 3)+' logs of '+padr(IntToStr(Players[i].Integers[1]), 3)+' | Active: '+padr(booltostr(Players[i].Active), 5)+' | '+padr(players[i].Loc, 22)+'|');

Good luck with your good looking scripting!

NiCbaZ

2009-03-06 07:35:49

Yes , nice codding, try and improve on your standars tho.

jakeyboy29

2009-03-06 08:42:33

yeh, post ur poker script as well.

Naike

2009-03-06 12:04:36

Yas!. Grats, you get in, by the time this is done.

marpis

2009-03-08 05:24:45

I tought i should send only 1 script ^^
but ok, here's my VideoPoker:

{

V I D E O P O K E R
by marpis

:::::::::::: Instructions ::::::::::::
:: S = Spades ::
:: C = Clubs ::
:: D = Diamonds ::
:: H = Hearts ::
:: ::
:: A = Ace ::
:: ___ ::
:: | | ::
:: --> |H9 | 9 of Hearts ::
:: |___| ::
:: ___ ::
:: | | ::
:: --> |DA | Ace of Diamonds ::
:: |___| ::
::::::::::::::::::::::::::::::::::::::
:: ::
:: PRESS START TO PLAY! ::
:: ::
::::::::::::::::::::::::::::::::::::::

}
program New;
type
TKortti = record
luku: integer;
maa: integer;
nimi: string;
pakassa: boolean;
kiinni: boolean;
end;

var
Kortit, Kadessa: array [0..51] of TKortti;
Kasi: integer;
Cash, panos: extended;
Kiinni: array [0..4] of boolean;
Pelikesken: boolean;

frmDesign : TForm;
Label1 : TMemo;
ccash : TLabel;
bet : TEdit;
setbet : TButton;
hold0 : TButton;
hold1 : TButton;
hold2 : TButton;
hold3 : TButton;
hold4 : TButton;
rel0 : TButton;
rel1 : TButton;
rel4 : TButton;
rel3 : TButton;
rel2 : TButton;
deal : TButton;
Timer1 : TTimer;

procedure TeePakka;
var
a: integer;
begin
Kortit[0].luku := 14;
Kortit[0].maa := 0;
Kortit[0].nimi := 'SA';


Kortit[1].luku := 14;
Kortit[1].maa := 1;
Kortit[1].nimi := 'CA';


Kortit[2].luku := 14;
Kortit[2].maa := 2;
Kortit[2].nimi := 'DA';


Kortit[3].luku := 14;
Kortit[3].maa := 3;
Kortit[3].nimi := 'HA';


Kortit[4].luku := 2;
Kortit[4].maa := 0;
Kortit[4].nimi := 'S2';


Kortit[5].luku := 2;
Kortit[5].maa := 1;
Kortit[5].nimi := 'C2';


Kortit[6].luku := 2;
Kortit[6].maa := 2;
Kortit[6].nimi := 'D2';


Kortit[7].luku := 2;
Kortit[7].maa := 3;
Kortit[7].nimi := 'H2';


Kortit[8].luku := 3;
Kortit[8].maa := 0;
Kortit[8].nimi := 'S3';


Kortit[9].luku := 3;
Kortit[9].maa := 1;
Kortit[9].nimi := 'C3';


Kortit[10].luku := 3;
Kortit[10].maa := 2;
Kortit[10].nimi := 'D3';


Kortit[11].luku := 3;
Kortit[11].maa := 3;
Kortit[11].nimi := 'H3';


Kortit[12].luku := 4;
Kortit[12].maa := 0;
Kortit[12].nimi := 'S4';


Kortit[13].luku := 4;
Kortit[13].maa := 1;
Kortit[13].nimi := 'C4';


Kortit[14].luku := 4;
Kortit[14].maa := 2;
Kortit[14].nimi := 'D4';


Kortit[15].luku := 4;
Kortit[15].maa := 3;
Kortit[15].nimi := 'H4';


Kortit[16].luku := 5;
Kortit[16].maa := 0;
Kortit[16].nimi := 'S5';


Kortit[17].luku := 5;
Kortit[17].maa := 1;
Kortit[17].nimi := 'C5';


Kortit[18].luku := 5;
Kortit[18].maa := 2;
Kortit[18].nimi := 'D5';


Kortit[19].luku := 5;
Kortit[19].maa := 3;
Kortit[19].nimi := 'H5';


Kortit[20].luku := 6;
Kortit[20].maa := 0;
Kortit[20].nimi := 'S6';


Kortit[21].luku := 6;
Kortit[21].maa := 1;
Kortit[21].nimi := 'C6';


Kortit[22].luku := 6;
Kortit[22].maa := 2;
Kortit[22].nimi := 'D6';


Kortit[23].luku := 6;
Kortit[23].maa := 3;
Kortit[23].nimi := 'H6';


Kortit[24].luku := 7;
Kortit[24].maa := 0;
Kortit[24].nimi := 'S7';


Kortit[25].luku := 7;
Kortit[25].maa := 1;
Kortit[25].nimi := 'C7';


Kortit[26].luku := 7;
Kortit[26].maa := 2;
Kortit[26].nimi := 'D7';


Kortit[27].luku := 7;
Kortit[27].maa := 3;
Kortit[27].nimi := 'H7';


Kortit[28].luku := 8;
Kortit[28].maa := 0;
Kortit[28].nimi := 'S8';


Kortit[29].luku := 8;
Kortit[29].maa := 1;
Kortit[29].nimi := 'C8';


Kortit[30].luku := 8;
Kortit[30].maa := 2;
Kortit[30].nimi := 'D8';


Kortit[31].luku := 8;
Kortit[31].maa := 3;
Kortit[31].nimi := 'H8';


Kortit[32].luku := 9;
Kortit[32].maa := 0;
Kortit[32].nimi := 'S9';


Kortit[33].luku := 9;
Kortit[33].maa := 1;
Kortit[33].nimi := 'C9';


Kortit[34].luku := 9;
Kortit[34].maa := 2;
Kortit[34].nimi := 'D9';


Kortit[35].luku := 9;
Kortit[35].maa := 3;
Kortit[35].nimi := 'H9';


Kortit[36].luku := 10;
Kortit[36].maa := 0;
Kortit[36].nimi := 'S10';


Kortit[37].luku := 10;
Kortit[37].maa := 1;
Kortit[37].nimi := 'C10';


Kortit[38].luku := 10;
Kortit[38].maa := 2;
Kortit[38].nimi := 'D10';


Kortit[39].luku := 10;
Kortit[39].maa := 3;
Kortit[39].nimi := 'H10';


Kortit[40].luku := 11;
Kortit[40].maa := 0;
Kortit[40].nimi := 'SJ';


Kortit[41].luku := 11;
Kortit[41].maa := 1;
Kortit[41].nimi := 'CJ';


Kortit[42].luku := 11;
Kortit[42].maa := 2;
Kortit[42].nimi := 'DJ';


Kortit[43].luku := 11;
Kortit[43].maa := 3;
Kortit[43].nimi := 'HJ';


Kortit[44].luku := 12;
Kortit[44].maa := 0;
Kortit[44].nimi := 'SQ';


Kortit[45].luku := 12;
Kortit[45].maa := 1;
Kortit[45].nimi := 'CQ';


Kortit[46].luku := 12;
Kortit[46].maa := 2;
Kortit[46].nimi := 'DQ';


Kortit[47].luku := 12;
Kortit[47].maa := 3;
Kortit[47].nimi := 'HQ';

Kortit[48].luku := 13;
Kortit[48].maa := 0;
Kortit[48].nimi := 'SK';


Kortit[49].luku := 13;
Kortit[49].maa := 1;
Kortit[49].nimi := 'CK';


Kortit[50].luku := 13;
Kortit[50].maa := 2;
Kortit[50].nimi := 'DK';


Kortit[51].luku := 13;
Kortit[51].maa := 3;
Kortit[51].nimi := 'HK';

for a:= 0 to 51 do
begin
Kortit[a].pakassa := true;
Kortit[a].kiinni := false;
end;
end;

Procedure ArvoKortti(num: integer);
var
i, a: integer;
begin
a:= -1;
repeat
i:= random(52)
if Kortit[i].pakassa then
begin
Inc(a);
Kadessa[num]:= Kortit[i];
Kortit[i].pakassa:=false;
end;
until(a > -1);
end;

procedure ArvoKortit;
var
a: integer;
begin
for a:= 0 to 4 do
begin
ArvoKortti(a);
end;
Label1.ScrollBars := false;
Label1.Text :=' ____ ____ ____ ____ ____ '+ #13 +
' | | | | | | | | | |'+ #13 +
' | '+padr(Kadessa[0].nimi, 3)+'| | '+padr(Kadessa[1].nimi, 3)+'| | '+padr(Kadessa[2].nimi, 3)+'| | '+padr(Kadessa[3].nimi, 3)+'| | '+padr(Kadessa[4].nimi, 3)+'|'+ #13 +
' |____| |____| |____| |____| |____| ';
for a:= 0 to 4 do
Kiinni[a] := false;

end;

procedure Hold(Sender: TObject);
begin
case Sender of
hold0:
begin
Kadessa[0].Kiinni := true;
hold0.visible := false;
rel0.visible := true;
Kiinni[0]:= true;
end;
hold1:
begin
Kadessa[1].Kiinni := true;
hold1.visible := false;
rel1.visible := true;
Kiinni[1]:= true;
end;
hold2:
begin
Kadessa[2].Kiinni := true;
hold2.visible := false;
rel2.visible := true;
Kiinni[2]:= true;
end;
hold3:
begin
Kadessa[3].Kiinni := true;
hold3.visible := false;
rel3.visible := true;
Kiinni[3]:= true;
end;
hold4:
begin
Kadessa[4].Kiinni := true;
hold4.visible := false;
rel4.visible := true;
Kiinni[4]:= true;
end;
end;
end;

function CountInts(X: Integer; TIA: TIntegerArray): Integer;//thanks nava2
var
I, H: Integer;
begin
H := High(TIA);
for I := 0 to H do
Result := Result + Integer(TIA[i] = x);
end;


procedure KatsoKasi;
{
Värisuora 7
Neloset 6
Täyskäsi 5
Väri 4
Suora 3
Kolmoset 2
Kaksi paria 1
Pari 0
}
var
i, a, parit, kolmoset, neloset: integer;
luvut: array [0..4] of integer;
maat: array [0..4] of integer;
begin
i:= -1;
for a:= 0 to 4 do
begin
luvut[a]:= Kadessa[a].luku;
maat[a]:= Kadessa[a].maa;
end;
//pari, 2 paria, kolmoset, täyskäsi, neloset
for a:= 0 to 4 do
begin
case CountInts(luvut[a], luvut) of
2: inc(parit);
3: inc(kolmoset);
4: inc(neloset);
end;
end;
if (parit = 2) then
i:= 0;
if (parit = 4) then
i:= 1;
if (kolmoset = 3) then
i:= 2;
if (kolmoset = 3) and (parit = 2) then
i:= 5;
if (neloset = 4) then
i:= 6;

//suora
if InIntArray(luvut, AMax(luvut)) and
InIntArray(luvut, AMax(luvut) -1) and
InIntArray(luvut, AMax(luvut) -2) and
InIntArray(luvut, AMax(luvut) -3) and
InIntArray(luvut, AMax(luvut) -4) then
i:= 3;
//väri
if (kadessa[0].maa = kadessa[1].maa) and
(kadessa[1].maa = kadessa[2].maa) and
(kadessa[2].maa = kadessa[3].maa) and
(kadessa[3].maa = kadessa[4].maa) then
i:= 4;
//värisuora
if InIntArray(luvut, AMax(luvut)) and
InIntArray(luvut, AMax(luvut) -1) and
InIntArray(luvut, AMax(luvut) -2) and
InIntArray(luvut, AMax(luvut) -3) and
InIntArray(luvut, AMax(luvut) -4) and
(kadessa[0].maa = kadessa[1].maa) and
(kadessa[1].maa = kadessa[2].maa) and
(kadessa[2].maa = kadessa[3].maa) and
(kadessa[3].maa = kadessa[4].maa) then
i:= 7;
//tarkastelu
Kasi:= i;
case Kasi of
-1: Label1.Text :=' No win!';
0:begin
Label1.Text :=' Pair : +'+FloatToStr(panos / 2)+'$';
Cash:= Cash + (panos / 2);
end;
1:begin
Label1.Text :=' Two pairs : +'+FloatToStr(panos*2)+'$';
Cash:= Cash + panos*2;
end;
2:begin
Label1.Text :=' Three-of-a-kind : +'+FloatToStr(panos*2)+'$';
Cash:= Cash + panos*2;
end;
3:begin
Label1.Text :=' Straight : +'+FloatToStr(panos*4)+'$';
Cash:= Cash + panos*4;
end;
4:begin
writeln(' Flush : +'+FloatToStr(panos*6)+'$');
Cash:= Cash + panos*6;
end;
5:begin
writeln(' Full house : +'+FloatToStr(panos*12)+'$');
Cash:= Cash + panos*12;
end;
6:begin
writeln(' Four-of-a-kind : +'+FloatToStr(panos*18)+'$');
Cash:= Cash + panos*18;
end;
7:begin
writeln(' Straight flush : +'+FloatToStr(panos*30)+'$');
Cash:= Cash + panos*30;
end;
end;
ccash.Caption := 'Cash: '+FloatToStr(cash)+' $';
end;

procedure UnHold(sender: TObject);
begin
case Sender of
rel0:
begin
Kadessa[0].Kiinni := false;
hold0.visible := true;
rel0.visible := false;
Kiinni[0]:= true;
end;
rel1:
begin
Kadessa[1].Kiinni := false;
hold1.visible := true;
rel1.visible := false;
Kiinni[1]:= true;
end;
rel2:
begin
Kadessa[2].Kiinni := false;
hold2.visible := true;
rel2.visible := false;
Kiinni[2]:= true;
end;
rel3:
begin
Kadessa[3].Kiinni := false;
hold3.visible := true;
rel3.visible := false;
Kiinni[3]:= true;
end;
rel4:
begin
Kadessa[4].Kiinni := false;
hold4.visible := true;
rel4.visible := false;
Kiinni[4]:= true;
end;
end;
end;


procedure AsetaPanos;
begin
panos:= StrToFloat(bet.Text);
if (panos > cash) then
begin
cleardebug;
writeln('HEY CHEATER! Dont bet bigger bets than your current money');
TerminateScript;
end;
Cash:= Cash - panos;
ccash.Caption := 'Cash: '+FloatToStr(cash)+' $';
pelikesken:= true;
end;

procedure Pelaa1(sender: TObject);
var
t: integer;
begin
if Pelikesken then
begin
Label1.text := 'Finish this round first by pressing Deal.';
setbet.Enabled := false;
deal.Enabled := false;
hold0.Enabled := false;
hold1.Enabled := false;
hold2.Enabled := false;
hold3.Enabled := false;
hold4.Enabled := false;
rel0.Enabled := false;
rel1.Enabled := false;
rel2.Enabled := false;
rel3.Enabled := false;
rel4.Enabled := false;
T := GetTickCount;
While GetSystemTime - T < 3000 Do
Begin
GetApplication.ProcessMessages;
Wait(1);
End;
setbet.Enabled := true;
deal.Enabled := true;
hold0.Enabled := true;
hold1.Enabled := true;
hold2.Enabled := true;
hold3.Enabled := true;
hold4.Enabled := true;
rel0.Enabled := true;
rel1.Enabled := true;
rel2.Enabled := true;
rel3.Enabled := true;
rel4.Enabled := true;
Label1.Text :=' ____ ____ ____ ____ ____ '+ #13 +
' | | | | | | | | | |'+ #13 +
' | '+padr(Kadessa[0].nimi, 3)+'| | '+padr(Kadessa[1].nimi, 3)+'| | '+padr(Kadessa[2].nimi, 3)+'| | '+padr(Kadessa[3].nimi, 3)+'| | '+padr(Kadessa[4].nimi, 3)+'|'+ #13 +
' |____| |____| |____| |____| |____| ';
Label1.Repaint;
exit;
end;
TeePakka;
AsetaPanos;
ArvoKortit;
hold0.Visible := true;
hold1.Visible := true;
hold2.Visible := true;
hold3.Visible := true;
hold4.Visible := true;
end;

procedure ResetGame;
begin
Label1.Text := 'Place your bet';
Label1.Repaint;
setbet.Enabled := true;
deal.Enabled := true;
hold0.Enabled := true;
hold1.Enabled := true;
hold2.Enabled := true;
hold3.Enabled := true;
hold4.Enabled := true;
rel0.Enabled := true;
rel1.Enabled := true;
rel2.Enabled := true;
rel3.Enabled := true;
rel4.Enabled := true;
hold0.visible := false;
hold1.visible := false;
hold2.visible := false;
hold3.visible := false;
hold4.visible := false;
rel0.visible := false;
rel1.visible := false;
rel2.visible := false;
rel3.visible := false;
rel4.visible := false;
ccash.Caption := 'Cash: '+FloatToStr(cash)+' $';
Pelikesken := false;
if (cash <= 0) then
begin
label1.text:= 'GAME OVER!';
deal.visible := false;
setbet.visible := false;
bet.visible := false;
ccash.visible := false;
end;
end;

procedure Pelaa2(sender: TObject);
var
a, t: integer;
begin
if not Pelikesken then
begin
Label1.Text :='Place your bet first!';
setbet.Enabled := false;
deal.Enabled := false;
hold0.Enabled := false;
hold1.Enabled := false;
hold2.Enabled := false;
hold3.Enabled := false;
hold4.Enabled := false;
rel0.Enabled := false;
rel1.Enabled := false;
rel2.Enabled := false;
rel3.Enabled := false;
rel4.Enabled := false;
T := GetTickCount;
While GetSystemTime - T < 2000 Do
Begin
GetApplication.ProcessMessages;
Wait(1);
End;
setbet.Enabled := true;
deal.Enabled := true;
hold0.Enabled := true;
hold1.Enabled := true;
hold2.Enabled := true;
hold3.Enabled := true;
hold4.Enabled := true;
rel0.Enabled := true;
rel1.Enabled := true;
rel2.Enabled := true;
rel3.Enabled := true;
rel4.Enabled := true;
exit;
end;
if (panos= 0) then
begin
Label1.Text :='Place your bet first!';
exit;
end;
setbet.Enabled := false;
deal.Enabled := false;
hold0.Enabled := false;
hold1.Enabled := false;
hold2.Enabled := false;
hold3.Enabled := false;
hold4.Enabled := false;
rel0.Enabled := false;
rel1.Enabled := false;
rel2.Enabled := false;
rel3.Enabled := false;
rel4.Enabled := false;
for a:= 0 to 4 do
begin
if not Kiinni[a] then
ArvoKortti(a);
end;
Label1.Text :=' ____ ____ ____ ____ ____ '+ #13 +
' | | | | | | | | | |'+ #13 +
' | '+padr(Kadessa[0].nimi, 3)+'| | '+padr(Kadessa[1].nimi, 3)+'| | '+padr(Kadessa[2].nimi, 3)+'| | '+padr(Kadessa[3].nimi, 3)+'| | '+padr(Kadessa[4].nimi, 3)+'|'+ #13 +
' |____| |____| |____| |____| |____| ';
Label1.Repaint;
T := GetTickCount;
While GetSystemTime - T < 4000 Do
Begin
GetApplication.ProcessMessages;
Wait(1);
End;
KatsoKasi;
T := GetTickCount;
While GetSystemTime - T < 2000 Do
Begin
GetApplication.ProcessMessages;
Wait(1);
End;
ResetGame;
end;

procedure FormStuff;
begin
frmDesign := CreateForm;
frmDesign.Position := poScreenCenter;
frmDesign.BorderStyle := bsSingle;
frmDesign.Left := 534;
frmDesign.Top := 283;
frmDesign.Width := 390;
frmDesign.Height := 180;
frmDesign.Caption := 'VideoPoker - by marpis!';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := false;
frmDesign.PixelsPerInch := 96;

Label1 := TMemo.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 8;
Label1.Top := 15;
Label1.Width := 250;
Label1.Height := 89;
Label1.Text := 'Place your bet';
Label1.Font.Color := clWindowText;
Label1.Font.Name := 'Courier New';
Label1.Font.Style := [];
ccash := TLabel.Create(frmDesign);
ccash.Parent := frmDesign;
ccash.Left := 270;
ccash.Top := 16;
ccash.Width := 145;
ccash.Height := 17;
ccash.Caption := 'Cash: '+FloatToStr(cash)+' $';
bet := TEdit.Create(frmDesign);
bet.Parent := frmDesign;
bet.Left := 270;
bet.Top := 48;
bet.Width := 100;
bet.Height := 21;
bet.TabOrder := 8;
bet.Text := '';
setbet := TButton.Create(frmDesign);
setbet.OnClick := @Pelaa1;
setbet.Parent := frmDesign;
setbet.Left := 270;
setbet.Top := 80;
setbet.Width := 100;
setbet.Height := 25;
setbet.Caption := 'Place your bet';
setbet.TabOrder := 9;
hold0 := TButton.Create(frmDesign);
hold0.visible := false;
hold0.Parent := frmDesign;
hold0.OnClick := @Hold;
hold0.Left := 8;
hold0.Top := 105;
hold0.Width := 49;
hold0.Height := 17;
hold0.Caption := 'Hold';
hold0.TabOrder := 8;
hold1 := TButton.Create(frmDesign);
hold1.Parent := frmDesign;
hold1.visible := false;
hold1.OnClick := @Hold;
hold1.Left := 56;
hold1.Top := 105;
hold1.Width := 49;
hold1.Height := 17;
hold1.Caption := 'Hold';
hold1.TabOrder := 9;
hold2 := TButton.Create(frmDesign);
hold2.Parent := frmDesign;
hold2.visible := false;
hold2.OnClick := @Hold;
hold2.Left := 104;
hold2.Top := 105;
hold2.Width := 49;
hold2.Height := 17;
hold2.Caption := 'Hold';
hold2.TabOrder := 10;
hold3 := TButton.Create(frmDesign);
hold3.Parent := frmDesign;
hold3.visible := false;
hold3.OnClick := @Hold;
hold3.Left := 152;
hold3.Top := 105;
hold3.Width := 49;
hold3.Height := 17;
hold3.Caption := 'Hold';
hold3.TabOrder := 11;
hold4 := TButton.Create(frmDesign);
hold4.Parent := frmDesign;
hold4.visible := false;
hold4.OnClick := @Hold;
hold4.Left := 200;
hold4.Top := 105;
hold4.Width := 49;
hold4.Height := 17;
hold4.Caption := 'Hold';
hold4.TabOrder := 12;
rel0 := TButton.Create(frmDesign);
rel0.Parent := frmDesign;
rel0.visible := false;
rel0.OnClick := @UnHold;
rel0.Left := 8;
rel0.Top := 121;
rel0.Width := 49;
rel0.Height := 17;
rel0.Caption := 'Unhold';
rel0.TabOrder := 13;
rel1 := TButton.Create(frmDesign);
rel1.Parent := frmDesign;
rel1.OnClick := @UnHold;
rel1.visible := false;
rel1.Left := 56;
rel1.Top := 121;
rel1.Width := 49;
rel1.Height := 17;
rel1.Caption := 'Unhold';
rel1.TabOrder := 14;
rel4 := TButton.Create(frmDesign);
rel4.Parent := frmDesign;
rel4.OnClick := @UnHold;
rel4.visible := false;
rel4.Left := 200;
rel4.Top := 121;
rel4.Width := 49;
rel4.Height := 17;
rel4.Caption := 'Unhold';
rel4.TabOrder := 15;
rel3 := TButton.Create(frmDesign);
rel3.Parent := frmDesign;
rel3.OnClick := @UnHold;
rel3.visible := false;
rel3.Left := 152;
rel3.Top := 121;
rel3.Width := 49;
rel3.Height := 17;
rel3.Caption := 'Unhold';
rel3.TabOrder := 16;
rel2 := TButton.Create(frmDesign);
rel2.Parent := frmDesign;
rel2.OnClick := @UnHold;
rel2.visible := false;
rel2.Left := 104;
rel2.Top := 121;
rel2.Width := 49;
rel2.Height := 17;
rel2.Caption := 'Unhold';
rel2.TabOrder := 17;
deal := TButton.Create(frmDesign);
deal.Parent := frmDesign;
deal.OnClick := @Pelaa2;
deal.Left := 270;
deal.Top := 105;
deal.Width := 100;
deal.Height := 33;
deal.Caption := 'DEAL';
deal.TabOrder := 18;
Timer1 := TTimer.Create(frmDesign);
Timer1.Interval := 4000;
end;

procedure ShowForm;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('FormStuff', v);
end;

procedure ShowformModal;
begin
frmDesign.ShowModal;
end;

procedure SafeShowModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowformModal', v);
end;


procedure Rahatilanne;
begin
clearreport;
AddToReport('Cash : '+FloatToStr(cash)+'$');
if (Cash <= 0) then
begin
cleardebug;
writeln('Y O U A R E O U T O F M O N E Y !');
writeln('Game over >:D');
terminatescript;
end;
end;

{*******************************************************************************
function strToIntArrayEx(intArray, Separater : String) : Array of Integer;
By: moparisthebest and Ron modified by Narcle
Description: Loads a String into an array of integer.
*******************************************************************************}
function strToIntArrayEx(intArray, Separater : String) : Array of Integer;
var
i, spacePos: Integer;
begin
try
repeat
SetArrayLength(Result, i + 1);
spacePos := Pos(Separater, intArray);
if (not (spacePos = 0)) then
Result[i] := StrToInt(Copy(intArray, 1, spacePos - 1))
else
begin
Result[i] := StrToInt(Copy(intArray, 1, Length(intArray)));
break;
end;
Delete(intArray, 1, spacePos);
i := i + 1;
until (False)
except
writeln('');
Writeln('Check your color setup, its incorrect.');
TerminateScript;
end;
for i := 0 to High(Result) do
begin
if Result[i] < 1 then
begin
swap(Result[i], Result[High(Result)])
SetArrayLength(Result, High(Result)-1);
end;
end;
end;

procedure ScriptTerminate;
begin
writeln('Thanks for playing!');
end;

begin
Cash:= 100; //CHEATER!!! QUICK SCROLL BACK UP!!!
TeePakka;
ShowForm;
SafeShowModal;
ClearReport;

end.

Nava2

2009-03-08 13:52:17

Yes, I like it.

case copy(GetUpText, 5, 3) of
'Wil': Inc(players[CurrentPlayer].integers[4]);
'Log': Inc(players[CurrentPlayer].integers[5]);
'Oak': Inc(players[CurrentPlayer].integers[6]);
'Yew': Inc(players[CurrentPlayer].integers[7]);
end;

That's sexy.

Also, combining TPAs is nice.

Btw, in your signature (Script) you could shorten it by using Copy and a for loop ;) Just a thought :)

procedure Signature;
var
I: Integer;
S: String;
begin
ClearDebug;
writeln(' __ __ _');
writeln(' / |_ _ _ | )| || )|\ |');
writeln(' \__ | ||_||_| & |_ )|_|| \| \|');
writeln(' |');
wait(2000);
S := 'by: marpis'
for I := 1 to 10 do
begin
ReplaceDebugline(3, ' | ' + Copy(S, 0, I));
wait(100);
end;
Writeln('');
Wait(2000);
end;

Method

2009-03-08 15:12:36

I've voted yes also. Good luck! :)

jakeyboy29

2009-03-09 09:02:54

4 days left. welcome i think?

Camaro'

2009-03-09 18:12:00

I thought it was excellent, although i dont think there is the axe breaking anymore. No doubt yes.

Home

2009-03-10 06:36:59

Yes, very promising :) See you in SRL Members ;)

Tervetuloa :) = Finnish.

~Home

Naum

2009-03-12 12:33:14

Can some one, 'In' this guy please?

Good script though.

Wizzup?

2009-03-20 21:19:32

First promotion on the server! Welcome. :)