mIRC Homepage
Posted By: Lusheous Problem getting on :JOIN script to work. - 08/12/15 07:41 PM
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
Posted By: westor Re: Problem getting on :JOIN script to work. - 08/12/15 07:53 PM
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. }
}
Thank you! smile

I'm still having trouble getting the script to initiate and send the variations based off the $nick .ini files.
Posted By: westor Re: Problem getting on :JOIN script to work. - 08/12/15 10:19 PM
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)
Posted By: Wolfie Re: Problem getting on :JOIN script to work. - 09/12/15 12:13 AM
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.~ }
}
The info.ini does exist, and it is formatted like an .ini.

[Name]
Gender=(text here)
Posted By: westor Re: Problem getting on :JOIN script to work. - 09/12/15 02:18 PM
Try to put the above code into an new file into the script editor and retry.
It's doing it on JOIN now, but it's still not telling the difference between registered nicks.
Posted By: westor Re: Problem getting on :JOIN script to work. - 09/12/15 03:39 PM
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.~ }
}
© mIRC Discussion Forums