mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2015
Posts: 2
R
Ravenna Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Nov 2015
Posts: 2
Below is the current script in the remotes of my Bot. I was wondering if it were possible to get it read the person's hostmask and write it into a ini file instead of their nick


Code:
alias startwithlower { 
  if ( $1 ) {
    return $islower($left($regsubex($$1,/\W+/g,$null),1))
  }
  else return $false
}

on 1:JOIN:#: {
  if ($readini(ini\title.ini,n,mistress,$nick)) {
    .describe $chan looks up and sees Mistress $nick $+ . "Tal Mistress."
  }
  elseif ($readini(ini\title.ini,n,master,$nick)) {
    .describe $chan looks up and sees Master $nick $+ . "Tal Master."
  }
  else {
    notice $nick Tal $nick I have no record of what you are. Please take the time to register that info with me. A pm will be spent to you 

shortly.
    msg $nick Please choose from one of the following titles: .Master or .Mistress 
}
on 1:text:*Mistress:?:{
  if ($1 == Mistress) { .msg $nick I see your trying to register as a Mistress, $nick $+ . To do so, please type 12 $+ .Mistress | halt 

}
  elseif ($1 == .Mistress) && (!$readini(ini\title.ini,n,mistress,$nick)) {
    if ( $startwithlower($nick) == $true ) { .msg $nick you cannot be addressed as Mistress | halt }
    else {
      /writeini ini\title.ini mistress $nick true
      msg $nick Tal Mistress. I will remember who you are when I see you.
    }
  }
}
on 1:text:*Master:?:{
  if ($1 == Master) { .msg $nick I see your trying to register as a Master, $nick $+ . To do so, please type 12 $+ .Master | halt }
  elseif ($1 == .Master) {
    if ( $startwithlower($nick) == $true ) { .msg $nick you cannot be addressed as Master | halt }
    else {
      /writeini ini\title.ini master $nick true
      msg $nick Tal Master. I will remember who you are when I see you.
    }
  }
}

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try use $address($nick,2) in order to get the user address.

/help $address


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Nov 2015
Posts: 2
R
Ravenna Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Nov 2015
Posts: 2
But wouldn't that mean it would only work for that particular nick?

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
You can optimize it by the parameter you give into the $address identifier, if you read at the help file you will understand.

e.g:

//echo -a is: $address($me,2) -> $me = your nickname
//echo -a is: $address(TEST-USER,2) -> TEST-USER nickname


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

Link Copied to Clipboard