Log in

View Full Version : Not sure how to phrase this.



KeepBotting
09-15-2012, 01:55 AM
Erm...how would I make it so the user can specify something (such as a color) and I can make the script do it? Sorry I sound so stupid, I'm really tired right now.

Sort of like Narcle's Fast Fighter, where the user inputs the color and UpText and the script will use that color and UpText while looking for the monster.

Nebula
09-15-2012, 02:00 AM
Have a user enter it as a constant

const
MonsterColor = 12345678;

riwu
09-15-2012, 02:03 AM
Const
MonsterColor=123456;

procedure Fight;
begin
FindColorsSpiralTolerance(x,y,MonsterColor,blabla) ;
//rest of stuff
end;
Though the SRL standard says you should use all CAPS for Const, i prefer camel case for readability ;)

Runaway
09-15-2012, 02:17 AM
Though the SRL standard says you should use all CAPS for Const, i prefer camel case for readability ;)

I believe the standard is CAPS_N_UNDERSCORES to maintain readability :p

@KB, you can also declare it in DeclarePlayers if you're using multiplayer to allow for different inputs for each player:


procedure DeclarePlayers;
Players[0].Name := 'fightinstuff';
Players[0].Integers[0] := 12345678;
//etc...

litoris
09-15-2012, 05:33 AM
^Was gonna say that, the players record includes arrays of strings and integers and whatnot, so you can just get the color declared there, and thus different accounts could have different settings.

KeepBotting
09-15-2012, 10:53 AM
Const
MonsterColor=123456;

procedure Fight;
begin
FindColorsSpiralTolerance(x,y,MonsterColor,blabla) ;
//rest of stuff
end;
Though the SRL standard says you should use all CAPS for Const, i prefer camel case for readability ;)When I do that it throws a type mismatch.

riwu
09-15-2012, 11:01 AM
When I do that it throws a type mismatch.
Uhm should be (MSCX,MSCY,TPA,MonsterColor, ...). Too lazy to type all the parameters XD.

KeepBotting
09-15-2012, 11:13 AM
Uhm should be (MSCX,MSCY,TPA,MonsterColor, ...). Too lazy to type all the parameters XD.
Oh, okay.
But if I want to use a simple FindObj?

riwu
09-15-2012, 11:22 AM
Oh, okay.
But if I want to use a simple FindObj?
Then just do what u normally do except replacing the color parameter with MonsterColor.

KeepBotting
09-15-2012, 11:29 AM
Then just do what u normally do except replacing the color parameter with MonsterColor.That threw a type mismatch. http://puu.sh/15hyD

litoris
09-15-2012, 11:36 AM
Then don't use findobj? It's primitive.

KeepBotting
09-15-2012, 11:38 AM
Then don't use findobj? It's primitive.Okay :D

riwu
09-15-2012, 11:50 AM
That threw a type mismatch. http://puu.sh/15hyD
Is that USERNAME a string? Show ur Const and the procedure.