mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2015
Posts: 4
L
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Dec 2015
Posts: 4
I'm trying to get my bot to distinguish between users that have made profiles for the chan RPG and those who have not, and send different messages to the chan accordingly.

I've gotten about this far:
Code:
on *:JOIN:#Gagged:{ mode #Gagged +v $nick 
  msg #Gagged Welcome to the club, $nick - 10Here's a complementary slice of tea, and a cup of ham sandwich. Enjoy!  
    if ($readini(info.ini,$Nick,Gender) != Yes) && (%Chan == $Chan) { msg #Gagged We here at the club noticed that you've not made a profile $+ ! Type !setup in chant to join the Secret Gag Alliance - We're waiting for you.~ | halt }
    if ($readini(info.ini,$nick,Gender) == Yes) && (%Chan == $Chan) { msg #Gagged Good to see you, $+ ! Your usual place within the Secret Gag Alliance has been reserved. Enjoy your stay, and please accept this coil of rope. }
}

But I'm not sure what I'm doing wrong. Any help would be greatly appreciated. Thank you. smile

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try use this code:

Code:
ON *:JOIN:#Gagged: {
  mode #Gagged +v $nick 
  msg $chan Welcome to the club, $nick - 10Here's a complementary slice of tea, and a cup of ham sandwich. Enjoy!  
  if ($readini(info.ini,$Nick,Gender) !== Yes) && (%Chan == $chan) { msg $chan We here at the club noticed that you've not made a profile $+ ! Type !setup in chant to join the Secret Gag Alliance - We're waiting for you.~ }
  elseif ($readini(info.ini,$nick,Gender) == Yes) && (%Chan == $chan) { msg $chan Good to see you, $+ ! Your usual place within the Secret Gag Alliance has been reserved. Enjoy your stay, and please accept this coil of rope. }
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2015
Posts: 4
L
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Dec 2015
Posts: 4
Thank you! smile

I'm still having trouble getting the script to initiate and send the variations based off the $nick .ini files.

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
First check for a global variable "%chan" if exist if not you must remove from the above code the "&& ($chan == %chan)" part, then check if the "info.ini" exists and also check if inside the info.ini the fields are formatted like an INI file.

e.g:

[NICKNAME]
Gender=Yes

To check if the "info.ini" exist use from the bot editbox: //echo -a $isfile(info.ini)

Last edited by westor; 08/12/15 10:20 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Originally Posted By: westor
Try use this code:

Code:
ON *:JOIN:#Gagged: {
  mode #Gagged +v $nick 
  msg $chan Welcome to the club, $nick - 10Here's a complementary slice of tea, and a cup of ham sandwich. Enjoy!  
  if ($readini(info.ini,$Nick,Gender) !== Yes) && (%Chan == $chan) { msg $chan We here at the club noticed that you've not made a profile $+ ! Type !setup in chant to join the Secret Gag Alliance - We're waiting for you.~ }
  elseif ($readini(info.ini,$nick,Gender) == Yes) && (%Chan == $chan) { msg $chan Good to see you, $+ ! Your usual place within the Secret Gag Alliance has been reserved. Enjoy your stay, and please accept this coil of rope. }
}


Perhaps this code would be a tad better...?
Code:
ON *:JOIN:#Gagged: {
  mode $chan +v $nick 
  msg $chan Welcome to the club, $nick - 10Here's a complementary slice of tea, and a cup of ham sandwich. Enjoy!
  if ($readini(info.ini,$nick,Gender) == Yes) { msg $chan Good to see you, $+($nick,!) Your usual place within the Secret Gag Alliance has been reserved. Enjoy your stay, and please accept this coil of rope. }
  else { msg $chan We here at the club noticed that you've not made a profile $+($nick,!) Type !setup in chant to join the Secret Gag Alliance - We're waiting for you.~ }
}

Joined: Dec 2015
Posts: 4
L
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Dec 2015
Posts: 4
The info.ini does exist, and it is formatted like an .ini.

[Name]
Gender=(text here)

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try to put the above code into an new file into the script editor and retry.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Dec 2015
Posts: 4
L
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Dec 2015
Posts: 4
It's doing it on JOIN now, but it's still not telling the difference between registered nicks.

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try use this code:

Code:
ON !*:JOIN:#Gagged: {
  mode $chan +v $nick 
  msg $chan Welcome to the club, $nick - 10Here's a complementary slice of tea, and a cup of ham sandwich. Enjoy!
  if ($readini(info.ini,$nick,Gender)) { msg $chan Good to see you, $+($nick,!) Your usual place within the Secret Gag Alliance has been reserved. Enjoy your stay, and please accept this coil of rope. }
  else { msg $chan We here at the club noticed that you've not made a profile $+($nick,!) Type !setup in chant to join the Secret Gag Alliance - We're waiting for you.~ }
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard