mIRC Home    About    Download    Register    News    Help

Print Thread
#28366 05/06/03 11:16 PM
W
Webmonkey
Webmonkey
W
Hi,
I'm making an RPG for IRC. I've already got the character creation started, but the code is really unorganized. It is using way too many variables, which will probably have major problems in the near future. Is there anyway to store it to a document, but the scripts being able to pull out any piece of information from the document it needs. Coudl you please explain how to make it store to a text document, and how I would go about retrieving the information needed from the document if it is possible.
Thanks,
Webmonkey

#28367 05/06/03 11:41 PM
I
Insert_Name_Here
Insert_Name_Here
I
se .ini files

/help $readini
/help $writeini

That should do what you need, howeer it will be slow. Use usual, you can use hash tables, and if yu decide to do them, get a hash tble editor script from www.mircscripts.org

#28368 06/06/03 12:20 AM
K
kupotek
kupotek
K
/help hash tables

#28369 06/06/03 01:06 AM
H
Hindsight
Hindsight
H
Ya id use hash for what your doing... sounds like youll need to store a lot of stuff and have it be fast. Hashish tables do both.

#28370 06/06/03 01:39 AM
C
CocaBear
CocaBear
C
personally /writeini would work good. I made an RPG fighting type game for irc.. it works ok. Its not the best coding job.. but it does the job smile There is out i store my Player info.

Code:
on *:text:#create:#: {
  if (%justran != 1) {
    if ($read(playerlist.txt, w, $nick)) { msg $chan Error! $nick already exsists in our Database. #stats for more info }
    else { 
      writeini players.ini $nick HP 50
      writeini players.ini $nick Kills 0
      writeini players.ini $nick Deaths 0
      writeini players.ini $nick COINS 0
      writeini players.ini $nick EXP 0
      writeini players.ini $nick ATK 0
      writeini players.ini $nick DEF 0
      ;Equipped Stuff
      writeini players.ini $nick equippedweapon BareHands
      writeini players.ini $nick equippedshield SmallShield
      ;Items
      writeini players.ini $nick BluePotion 0
      writeini players.ini $nick CrystalBluePotion 0
      writeini players.ini $nick HealPotion 0
      writeini players.ini $nick GreaterHealPotion 0
      writeini players.ini $nick ElixerOfHeal 0
      ;Weapons
      writeini players.ini $nick BareHands 1
      writeini players.ini $nick Dagger 0
      writeini players.ini $nick ShortSword 0
      writeini players.ini $nick LongSword 0 
      writeini players.ini $nick Claymore 0 
      writeini players.ini $nick KeldriniteLS 0
      ;Shields
      writeini players.ini $nick SmallShield 1
      writeini players.ini $nick LargeShield 0
      writeini players.ini $nick MetalShield 0
      writeini players.ini $nick IronShield 0
      writeini players.ini $nick DragonShield 0
      writeini players.ini $nick HeavenlyShield 0
      ;misc items
      writeini players.ini $nick Fish 0
      writeini players.ini $nick SmallRock 0
      writeini players.ini $nick Ruby 0

      write playerlist.txt $nick
    msg $chan You're character has been created! }
    /set -u5 %justran 1  
  }
}


I know someone could make this much easier and faster.. but i haven't got great mirc scripting skills smile

and this is how it stores..

Code:
[Hazor]
HP=50
Kills=0
Deaths=0
COINS=0
EXP=0
ATK=0
DEF=0
equippedweapon=BareHands
equippedshield=SmallShield
BluePotion=0
CrystalBluePotion=0
HealPotion=0
GreaterHealPotion=0
ElixerOfHeal=0
BareHands=1
Dagger=0
ShortSword=0
LongSword=0
Claymore=0
KeldriniteLS=0
SmallShield=1
LargeShield=0
MetalShield=0
IronShield=0
DragonShield=0
HeavenlyShield=0
Fish=0
SmallRock=0
Ruby=0



Hope this helps

Coca-Bear

#28371 06/06/03 02:27 AM
W
Webmonkey
Webmonkey
W
Hey...
Coca... this is MNavenger. Do you think you could send me the rpg game? I'll give you some credit for giving me a frame to look at for the game i'm making, if so send it compress or whatever way you can give it to me: Webmonkey@hisword.com I would greatly appreciate it. I'm trying to make mine more Role Playing like, but I need some good ideas for the combat system...
Thanks


Link Copied to Clipboard