Bandit Posted November 21, 2004 Report Share Posted November 21, 2004 Hey, I need a little bit of help with scripting a bot for an IRC RPG. I simply need a bot to store information about a players character e.g Money etc and then to add or subtract from the money(plus some other stuff) when players buy things. If someone can help me with this It would be much appreciated. Quote Link to post Share on other sites
Helio Posted November 21, 2004 Report Share Posted November 21, 2004 making an IRC rpg isn't an easy task, but I can give you an idea where to start using mIRC.First you'll need to read up on "on text" events in mIRC, they will be the interface your players will use.Then you will need to learn about "hash tables" which are the best way to store info. hash tables are lists of variables, similar to a spreadsheet (though not nearly as powerful). Next would be tokens, though not required, they allow you to store alot of info into 1 hash table entry then you normally would.The only thing that remains is timers, which would be used for random events.IRC rpgs can be complex, so it's best to read the help file before starting, it can save alot of headaches. good luck Quote Link to post Share on other sites
Bandit Posted November 22, 2004 Author Report Share Posted November 22, 2004 thanks for the response, actually since then, i've spoken to a few people and got a bit of help,tbh, i've already made the game, the bot just automates certain sections of the game like buying buildings or getting income. What I would really like to know, is how to set a variable,such as money, then increase or decrease it depending on if people type certain phrases into the game, like !buy xxxx.If you could help me with that specifically, that would be great. Quote Link to post Share on other sites
Helio Posted November 22, 2004 Report Share Posted November 22, 2004 well, if the language is mIRC script, then to set a variable would be:/set %variable valueto increase by 1, would be:/inc %variableto decrease by 1 would be:/dec %variable Quote Link to post Share on other sites
Bandit Posted November 22, 2004 Author Report Share Posted November 22, 2004 thanks for that, i have tried to make a small section of script for the game, but as it is my 1st, it isn't quite working yet. Could you tell me what I need to change/do to get this bit to work?Thanks in advanceon 1:TEXT:!buy %quantity Fishing Boats:*:{ set %price 10dec %gc $calc (%price * %quantity)writeini $nick $+ .ini Inventory GC %gc/msg $chan You have bought %quantity Fishing Boats} Quote Link to post Share on other sites
Helio Posted November 22, 2004 Report Share Posted November 22, 2004 the match text part of the event is off, mIRC script is very simple when it comes to that. on 1:TEXT:!buy %quantity Fishing Boats:*:{should be:on 1:TEXT:!buy * Fishing Boats*:*:{set %quantity $2the set %quantity $2 stores the second word in the line which matched the event (in your case, the quantity of boats) and stores it into the variable. The rest of the code looks good, but you may want to check %gc, from what it looks like it is a global gold count. I don't know the rest of the code, so I can't tell if that's what you want to do or not. Quote Link to post Share on other sites
Bandit Posted November 23, 2004 Author Report Share Posted November 23, 2004 yep, that worked perfectly, the bot is almost finished, im just having trouble with one final part. This section is designed to increase the amount of GC a person has when they type !income. I have tried several things but nothing seems to work. here is what I have so far.on 1:TEXT:!income $2* *:*:{inc %GC $2/msg $chan $nick currently have %gc GCthat is just the particular section of the code, if you need the rest of the script, I can provide that as well. Thanks Quote Link to post Share on other sites
Helio Posted November 24, 2004 Report Share Posted November 24, 2004 you don't need the $2 in the event at all, mirc fills it automatically, plus the extra space may throw off the matching. try:on 1:TEXT:!income*:*:{ Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.