mIRC Homepage
Posted By: WildCard remote command functions - 03/03/06 03:51 AM
i am usally away from home but i would like my home computer to join, part, change nick, kick, ban etc... only a few commands. i do not want to install a bot script. the command would be in msg. like this:
!nick WildCard <<to change nick to wildcard>>
!part #channel
!join #channel
!identify password

how would this be scripted on my home computer? if i can get the basic function i can just copy and paste for each command. thank you for your time
Posted By: genius_at_work Re: remote command functions - 03/03/06 04:25 AM
/help on text

-genius_at_work
Posted By: schaefer31 Re: remote command functions - 03/03/06 05:01 AM
All commands sent through private message/query. The code goes in remote scripts (alt + r).

You may need to change the red colored text. I just assume the network you are on uses NickServ, if not then change it as needed.

At the bottom is a commented out skeleton code for adding another command. It should be easy to figure out. Be sure to remove the semi-colons if copying the code.

Code:
on *:TEXT:*:?:{
  [color:green]; !join #channel / !part #channel[/color]
  if ($regex($2,/^#[\S]/)) {
    if ($1 == !join) {
      if ($me !ison $2) join $2
      else .msg $nick I am already on $2
    }
    if ($1 == !part) {
      if ($me ison $2) part $2
      else .msg $nick I am not on $2
    }
  }
  [color:green]; !nick &lt;new-nick&gt;[/color]
  if ($1 == !nick) {
    if ($2 &amp;&amp; $regex($2,/^[a-zA-Z\[\]\{\}\\`^]/)) { nick $2 }
    else .msg $nick Invalid nick.
  }
  [color:green]; !identify[/color]
  if ($1 == !identify) .msg [color:red]NickServ identify nick pass[/color]

  [color:green]; if ($1 == !new-command) {
  ; do stuff here
  ; }[/color]
}
Posted By: Doqnach Re: remote command functions - 04/03/06 10:02 AM
you should rather use elseif instead of if's here...

mIRC will try and evaluate all the if's you put in here what is useless, it should stop at the one it was looking for...


so:

if
elseif
elseif
elseif
else

is a much better construction
© mIRC Discussion Forums