SRL Archive - Help and Support

any other way to do this


RudeBoiAlex

2007-06-30 07:26:02

well in my players array

Procedure DeclarePlayers;
//If Not Using Any Left Over Players Delete There Forms.


Begin
HowManyPlayers:= NumberOfUsers;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := StartPlayer;


Players[0].Name :='Username';
Players[0].Pass :='Password';
Players[0].Nick :='3 Leters Of Youre Name';
Players[0].Integer1 := 5;//this is How many chickens to kill
Players[0].String1 :='Lobbies';//Valid: Lobbies,Trout,Herring,Shrimp Or NoFood.
Players[0].Active:=True;


Players[1].Name :='Username';
Players[1].Pass :='Password';
Players[1].Nick :='3 Leters Of Youre Name';
Players[1].Integer1 := 5;//this is How many chickens to kill
Players[1].String1 :='Lobbies';//Valid: Lobbies,Trout,Herring,Shrimp Or NoFood.
Players[1].Active:=True;


Players[2].Name :='Username';
Players[2].Pass :='Password';
Players[2].Nick :='3 Leters Of Youre Name';
Players[2].Integer1 := 5;//this is the loads!!
Players[2].String1 :='Lobbies';//Valid: Lobbies,Trout,Herring,Shrimp Or NoFood.
Players[2].Active:=True;


Players[3].Name :='Username';
Players[3].Pass :='Password';
Players[3].Nick :='3 Leters Of Youre Name';
Players[3].Integer1 := 5;//this is How many chickens to kill
Players[3].String1 :='Lobbies';//Valid: Lobbies,Trout,Herring,Shrimp Or NoFood.
Players[3].Active:=True;


Players[4].Name :='Username';
Players[4].Pass :='Password';
Players[4].Nick :='3 Leters Of Youre Name';
Players[4].Integer1 := 5;//this is How many chickens to kill
Players[4].String1 :='Lobbies';//Valid: Lobbies,Trout,Herring,Shrimp Or NoFood.
Players[4].Active:=True;

NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
End;

i have a string1

in my eatfood procedure instead of

If Players[CurrentPlayer].String1 = 'lobbies' Then if Findcolor ect...
if Players[CurrentPlayer].String1 = 'herring'Then if Findcolor ect...
how could i do it all in 1

o yeh ignore the chickens to fight changeing that soon

Bobarkinator

2007-06-30 08:19:24

case?
begin
case Players[CurrentPlayer].Sting1 of
'trout' : begin
FindColor(...);
Etc.
end;
'lobster': begin
FindColor(...);
etc.
end;
end;
end;

RudeBoiAlex

2007-06-30 09:15:32

ever heard of 'im not good at cases' is there a tut around ty newai

NewToAutoing

2007-06-30 11:10:56

Cases just work as if then statements.


begin
case ThisVariable of
0: dothis;
1: dothis;
2: dothis;
end;
end;

Is the same thing as saying


begin
if (ThisVariable = 0) then
DoThis;
if (ThisVariable = 1) then
DoThis;
if (ThisVariable = 2) then
DoThis;
end;

So you'd do..

begin
case Players[CurrentPlayer].String1 of
'trout':
begin
if FindDTM(TroutDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
Mouse(x,y,2,2,true);
end;
'lobster':
begin
if FindDTM(LobsterDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
Mouse(x,y,2,2,true);
end;
end;
end;

Something like that. But change it to the way you like.

Bobarkinator

2007-06-30 11:11:22

I didn't see one. Maybe it will be my next tut :D

RudeBoiAlex

2007-06-30 12:55:30

hmm newtoautoing thats confusing but it think i get it ill post my version if i get it

edit: i dont think this is right

Procedure EatFood;
begin
case Players[CurrentPlayer].String1 of
'trout':
begin
if FindColorTolerance(x,y,7501455,MIX1,MIY1,MIX2,MIY2,15)) Or
(FindColorTolerance(x,y,6580094,MIX1,MIY1,MIX2,MIY2,15)) Then
MMouse(x,y,1,1);
If(IsUpText('Eat')) Then
Mouse(x,y,1,1,True);
End;
end;
'lobster':
begin
if (FindColorTolerance(x,y,1334448,MIX1,MIY1,MIX2,MIY2,15)) Or
(FindColorTolerance(x,y,1733852,MIX1,MIY1,MIX2,MIY2,15)) Then
MMouse(x,y,1,1)
If (IsUpText('Eat')) Then
Mouse(x,y,1,1,True);
End;
End;

NewToAutoing

2007-06-30 16:27:48

It's right except it's a little messy cause of the standards and you have one too many ends in part of the case. Would be better (and shorter(and simpler)) with a DTM though :p And a failsafe for if it doesn't find any food to run or something, depending on your script.

RudeBoiAlex

2007-06-30 16:31:24

ahh ok thanks a bunch yeh i will use dtms for em ty i think i got standards two spaces for a begin 2 spaces back for an end??

NewToAutoing

2007-06-30 21:37:10

That's the basis of it yeah. There's stuff like cases (for example) which also have certain spacing. And if..then statements with only one command, etc. Stuff like that.

RudeBoiAlex

2007-07-01 03:18:29

errrmmm ok lol