mIRC Home    About    Download    Register    News    Help

Print Thread
Linkin's General Help Request Thread #258815 02/09/16 05:24 AM
Joined: Jul 2014
Posts: 9
L
Linkin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Jul 2014
Posts: 9
Okay..... So I can already tell I am going to have WAY too many questions and to be polite of others I'm just going to make one thread dedicated to my questions. Hopefully this is okay -- if not, just let me know. (Also, this way if someone is tired of helping me they can just ignore my thread. lol)

So my first question I think is just a general understanding question: When using access levels I understand there are numeric and named levels. With the numeric levels, the higher the level, the more you can access, esentially. But what about the named levels? do they have a way to incorporate them with the numeric levels?
Example: I have a level 1, a level 10, a level named "helper" and a level 100. Is there anyway to make the level "helper" valued above 10 so that when a script is written for level 10 and up it allows the "helper" level to execute it as well?
(God I hope that made sense....)

My second question for the night: My end goal for scripting is to make an RPG-bot (specifically Zoids if any of you remember that anime). I'm already stuck at the first stage which is getting people registered to the bot. In other words, I want people to register their nickname (preferably only nicknames that are registered with the nickserv but I can learn about that later if its complicated.) to a Zoid and with a password so that every time they come back they will have their saved stats and progress. My question is what command do I need to google to find help topics. I guess I'm confused as to what exactly I'm trying to get the bot to do at this point. My guess right now is I'm looking at write ini and read ini commands? Does that sound like the correct steps?

I apologize for the lengthy post and my possibly horrible explanation of things, but I do appreciate any help that I get. <3

Re: Linkin's General Help Request Thread [Re: Linkin] #258821 02/09/16 11:36 AM
Joined: Feb 2015
Posts: 243
O
OrFeAsGr Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
ini is a good type of file to save stuff it has an okay speed and easy to edit i think.
So yes you should probably try $readini and /writein
My advice regarding structure of the file would be to make seperate sections for each userwhere all his info, stats, progress would be saved.
So the file would look something like this
Code:
[OrFeAsGr]
Lvl=1
Money=500
MoreStuff=1000
[Linkin]
LvL=500
Money=300000
MoreStuff=1000000

Just an example. You can put as many values as you want in each section.
I hope i helped! Good luck with your game!

Re: Linkin's General Help Request Thread [Re: Linkin] #258827 02/09/16 01:07 PM
Joined: Jul 2006
Posts: 3,530
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,530
Named access level don't mix really well with numbered access level. To mix them up, you would need to match any level in your event with * and then check $ulevel and make some if ($ulevel >= 10) || ($ulevel == helper), BUT also check this link because it's not so simple to deal with this, you may want to create your own access level.
http://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/254260

Also, if you are going to have a lot of quick questions, it's better to use IRC.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Linkin's General Help Request Thread [Re: Wims] #258830 02/09/16 02:03 PM
Joined: Jul 2014
Posts: 9
L
Linkin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Jul 2014
Posts: 9
Thank you guys! I appreciate all the info.

And yes, Wims, I will be utilizing IRC for questions as well but last night I couldn't find a server and channel that I knew for help. I was given a couple in a different thread to try, so I'll be doing that. smile

Re: Linkin's General Help Request Thread [Re: Linkin] #258855 05/09/16 04:43 AM
Joined: Jul 2014
Posts: 9
L
Linkin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Jul 2014
Posts: 9
Code:
;Registering
on *:TEXT:`Register:*:{
  if ($readini($nick $+ .ini,$nick,Registered) == Yes) { 
    /notice $nick You have already registered. | halt
  }
  /notice $nick Welcome to the registration process. Please type `zoids to see a list of available zoids. Type `register <zoid name> to finish registration.
}
on *:TEXT:`Register *:*:{
  if ($readini($nick $+ .ini,$nick,Registered) == Yes) {
    /notice $nick You have already registered. | halt
  }
  if ($2- == Molga) {
    /writeini $nick $+ .ini $nick ActiveZoid Molga
    /writeini $nick $+ .ini $nick Money 500
    /writeini $nick $+ .ini $nick Registered Yes
    /writeini $nick $+ .ini $2 CurrentHealth 1000
    /writeini $nick $+ .ini $2 BaseHealth 1000
    /writeini $nick $+ .ini $2 Speed 40
    /writeini $nick $+ .ini $2 Defense 80
    /writeini $nick $+ .ini $2 Attack 30
    /writeini $nick $+ .ini $2 Move1 Laser Cutter
    /writeini $nick $+ .ini $2 Move2 20mm Gatling Gun
    /notice $nick You have registered in the $2-. | halt
  }
  if ($2- == Cannon Tortoise){
  /writeini $nick $+ .ini $nick ActiveZoid Cannon Tortoise
  /writeini $nick $+ .ini $nick Money 500
  /writeini $nick $+ .ini $nick Registered Yes
  /writeini $nick $+ .ini $2 $+ $3 CurrentHealth 1200
  /writeini $nick $+ .ini $2 $+ $3 BaseHealth 1200
  /writeini $nick $+ .ini $2 $+ $3 Speed 49
  /writeini $nick $+ .ini $2 $+ $3 Defense 140
  /writeini $nick $+ .ini $2 $+ $3 Attack 30
  /writeini $nick $+ .ini $2 $+ $3 Move1 LHC Beam Gun
  /writeini $nick $+ .ini $2 $+ $3 Move2 LHC Cannon Gun
  /notice $nick You have registered in the $2-. | halt
}
if ($2- == Sea Striker){
/writeini $nick $+ .ini $nick ActiveZoid Sea Striker
/writeini $nick $+ .ini $nick Money 500
/writeini $nick $+ .ini $nick Registered Yes
/writeini $nick $+ .ini $2 $+ $3 CurrentHealth 1000
/writeini $nick $+ .ini $2 $+ $3 BaseHealth 1000
/writeini $nick $+ .ini $2 $+ $3 Speed 100
/writeini $nick $+ .ini $2 $+ $3 Defense 70
/writeini $nick $+ .ini $2 $+ $3 Attack 17
/writeini $nick $+ .ini $2 $+ $3 Move1 Homing Torpedo
/writeini $nick $+ .ini $2 $+ $3 Move2 Accelerated Beam Gun
/notice $nick You have registered in the $2-. | halt
}}


So I've run into a problem that I think is just something I'm missing...again. The problem I believe is with the "Cannon Tortoise" section. If I type for Molga, the ini file writes just fine, same with the Cannon Tortoise. However, the Sea Striker will write with this information:

Quote:
[Linkin]
ActiveZoid=Cannon Tortoise
Money=500
Registered=Yes

[seastriker]
CurrentHealth=1200
BaseHealth=1200
Speed=49
Defense=140
Attack=30
Move1=LHC Beam Gun
Move2=LHC Cannon Gun


The same will happen with anything that follows "Cannon Tortoise" (I've tried rearranging the code so that Cannon Tortoise goes first). Everything looks identical as far as coding goes, and I'm pretty sure I have the correct amount of brackets... any other ideas? (Thank you!)

Re: Linkin's General Help Request Thread [Re: Linkin] #258872 06/09/16 11:34 PM
Joined: Jul 2014
Posts: 9
L
Linkin Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
L
Joined: Jul 2014
Posts: 9
Nevermind. Looks like I found my error. Putting a space before all my "{" fixed my problem. smile