|XP is just a number|
Re^4: Return full line from line number Xby Rathlar (Initiate)
|on Oct 27, 2008 at 02:51 UTC||Need Help??|
no... there will be a list on a php page which will be numbered according to thier line position in the file... so i'll paste a couple lines from the file so you can get a better idea...
258 Phontom Fungus
the numbers represent the monster's attack value ($mnum) and the name is obviously $mname
now lets say these are lines 51-54... lets say a player put in the command to battle $mline which in this case would be 53
so $mline = 53 now which is the line i need to snag and then split to get the proper values.
most of the other code in here doesn't really have anything to do with what I'm doing... its about 4k lines of code... but i could give you an example of the player sending the command via IRC... this would be the command that i'm making which would trigger the sub that I originally asked for help with.
basically most of it is just a bunch of checks to make sure the fight is possible... once we determine that, to starts the monster_battle sub pitting the player against the monster that was specified. $arg4 is the input the player gives which in this case should be the line number 53 meaning that the player wishes to fight with a "Mennlock" with an attack rating of "267"
the line numbers will only be supplied on the php page which is just a quick reference to the player so that they can just type /msg botname battle 53