mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
Code:
alias -l new.account {
  if ($2 == $null) { msg $1 Please state your requested nickname. (IE. !register dave the barbarian | halt }
  elseif (get.name($1) != $null) { msg $1 You have already have a registered name! ( $+ $get.name($1) $+ ) | halt }
  else { /writeini rpg_bot.ini XP $1 0
    /writeini rpg_bot.ini NAMES $1 $2
/writeini rpg_bot.ini MONEY $1 2000  } }

And of course thats not all the ini's i want, but it won't write the ini, it won't message the person, nor will it come up with an error.
If you could help, thanks! laugh

Activation
Code:
on *:TEXT:!register:#rpg: { /new.account $nick,$2- }


Chat NSN
My Server: sleepystickman.ircxpro.com
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
This should address the many errors of your version..

Code:
on *:text:!register *:#: {
  if (!$2) { msg $nick State the nickname you wish to register. (IE: !register dave the barbarian) }
  elseif ($get.name($nick)) { msg $nick You already have a nickname registered. }
  else {
    writeini -n rpg_bot.ini XP $nick 0
    writeini -n rpg_bot.ini NAME $nick $2-
    writeini -n rpg_bot.ini MONEY $1 2000
    msg $nick Your RPG nickname is: $2-
  }
}
alias -l get.name { if ($readini(rpg_bot.ini, NAME, $1)) { return $true } }


Personally, you'd be better off looking into hash tables, they're much quicker to deal with.

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
try it without using the pipe "|" methos, especially while working out a problem

Code:
on *:TEXT:!register:#rpg: { new.account [color:red] $nick $2- [/color]}
alias -l new.account {
  if ($2 == $null) { 
    msg $1 Please state your requested nickname. IE. !register dave the barbarian 
  }
  elseif ( [color:green]get.name($1) [/color] != $null) { 
    msg $1 You have already have a registered name! ( $+ $get.name($1) $+ ) 
  }
  else { 
    writeini rpg_bot.ini XP $1 0
    writeini rpg_bot.ini NAMES $1 [color:red]$2- [/color]
    writeini rpg_bot.ini MONEY $1 2000  
  } 
}


look over the changes I posted and test it, hopefully it will work now
also note that in scripts the "/" is assumed and you do not need to put it in the code.
and you had "halt", the "if" having failed will stop any command from triggering
get.name($1) do you have another alias somewhere? if so maybe just add a $ $get.name($1) maybe you need a $readini here ?

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
man I am just too slow crazy

Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
alright i modded my script to look like this:
Code:
alias -l new.account {
  if ($2 == $null) { 
    msg $1 Please state your requested nickname. (IE. !register dave the barbarian)
  }
  elseif ($get.name($1) != $null) { 
    msg $1 You have already have a registered name! ( $+ $get.name($1) $+ ) 
  }
  else { 
    writeini rpg_bot.ini XP $1 0
    writeini rpg_bot.ini NAMES $1 $2- 
    writeini rpg_bot.ini MONEY $1 2000  
    msg $1 You have regestered.
    msg.info $1 $1
  } 
}

Alias
Code:
on *:TEXT:!register:#rpg: { new.account $nick $2- }

Alias 2
Code:
alias -l msg.info { msg $iif($2 == $null,#,$2) $get.name($1) is $nick $+ 's name. He/She has $get.money($1) gold, $get.xp($1) }

aaaaaaaaaand now the same result came (no ini or errors)


Chat NSN
My Server: sleepystickman.ircxpro.com
Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
HAHAHAHAHAH! my god i found the stupid error...
thanks guys/gals
Code:
on *:TEXT:!register[color:green]*[/color]:#rpg: { new.account $nick $2- }

Didn't have the wildcard there


Chat NSN
My Server: sleepystickman.ircxpro.com
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
You are using:
Code:
on *:TEXT:!register:#rpg: { new.account $nick $2- }


Note that this will only trigger if this is the *ONLY* thing typed. Meaning there can be no $2-, because anything other than !register, will fail the match text.

You need:

Code:
on *:TEXT:!register [color:red]*[/color]:#rpg: { new.account $nick $2- }


Edit:

Keep a space between your !register and your wildcard, otherwise it will trigger when someone types: !registeromgthisatest nickname.

Joined: Oct 2005
Posts: 54
B
Babel fish
OP Offline
Babel fish
B
Joined: Oct 2005
Posts: 54
just a tad late there.... :P


Chat NSN
My Server: sleepystickman.ircxpro.com
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Yep, I saw, that's why I wrote the "Edit" line to it. =]


Link Copied to Clipboard