mIRC Home    About    Download    Register    News    Help

Print Thread
Problem getting on :JOIN script to work. #255971 08/12/15 07:41 PM
Joined: Dec 2015
Posts: 4
L
Lusheous Offline OP
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

Re: Problem getting on :JOIN script to work. [Re: Lusheous] #255972 08/12/15 07:53 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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. }
}

Re: Problem getting on :JOIN script to work. [Re: westor] #255973 08/12/15 08:48 PM
Joined: Dec 2015
Posts: 4
L
Lusheous Offline OP
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.

Re: Problem getting on :JOIN script to work. [Re: Lusheous] #255975 08/12/15 10:19 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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.
Re: Problem getting on :JOIN script to work. [Re: westor] #255977 09/12/15 12:13 AM
Joined: Aug 2003
Posts: 325
W
Wolfie Offline
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.~ }
}

Re: Problem getting on :JOIN script to work. [Re: westor] #255980 09/12/15 12:43 AM
Joined: Dec 2015
Posts: 4
L
Lusheous Offline OP
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)

Re: Problem getting on :JOIN script to work. [Re: Lusheous] #255994 09/12/15 02:18 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Try to put the above code into an new file into the script editor and retry.

Re: Problem getting on :JOIN script to work. [Re: westor] #255996 09/12/15 02:52 PM
Joined: Dec 2015
Posts: 4
L
Lusheous Offline OP
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.

Re: Problem getting on :JOIN script to work. [Re: Lusheous] #255998 09/12/15 03:39 PM
Joined: Dec 2008
Posts: 1,511
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
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.~ }
}