Author Topic: Basic bot control snippets (!join | !part)  (Read 233 times)

King_Hual

  • Trial Moderator
  • Newbie
  • ***
  • Posts: 36
  • Reputation +3/-2
    • View Profile
Basic bot control snippets (!join | !part)
« on: February 11, 2011, 03:04:31 pm »
First: The script that uses the owner system that I posted before.
Code: [Select]
on owner:text:!join*:*:{
  if ($me ison $$2) {
    notice $nick 4I am in that channel already
  }
  else {
    join $$2
    notice $nick I joined $$2
  }
}

on owner:text:!part*:#:{
  if ($me ison $$2) {
    notice $nick 4I left $$2
    part $$2
  }
  else {
    notice $nick 4I am not in that channel
  }
}

on owner:text:!rejoin*:#:{
  if ($$2 == $null) {
    notice $nick 7,1Usage: !rejoin <channel>
  }
  if ($me ison $$2) {
    hop $$2   
    notice $nick 4I rejoined $$2
  }
  else {
    notice $nick 4I am not in that channel
  }
}

on owner:text:!partall*:#:{
  if ($2 == $null) {
    partall
  }
  else {
    partall
    timer 1 1 join $$2
    ;The timer above is for exceptions. For example: !partall #king_hual will part all channels except #king_hual. You can add multiple channels to the exception, by putting a comma (,) between them. Example: #king_hual,#scripters,#jane
  }
}

Or, if you don't use the owner system I posted:
Code: [Select]
on *:text:!join*:*:{
  if ($nick == yournamehere) {
    if ($me ison $$2) {
      notice $nick 4I am in that channel already
    }
    else {
      join $$2
      notice $nick I joined $$2
    }
  }
}

on *:text:!part*:#:{
  if ($nick == yournamehere) {
    if ($me ison $$2) {
      notice $nick 4I left $$2
      part $$2
    }
    else {
      notice $nick 4I am not in that channel
    }
  }
}

on *:text:!rejoin*:#:{
  if ($nick == yournamehere) {
    if ($$2 == $null) {
      notice $nick 7,1Usage: !rejoin <channel>
    }
    if ($me ison $$2) {
      notice $nick 4I rejoined $$2
      hop $$2
    }
    else {
      notice $nick 4I am not in that channel
    }
  }
}

on *:text:!partall*:#:{
  if ($nick == yournamehere) {
    if ($2 == $null) {
      partall
    }
    else {
      partall
      timer 1 1 join $$2
     ;The timer above is for exceptions. For example: !partall #king_hual will part all channels except   #king_hual. You can add multiple channels to the exception, by putting a comma (,) between them. Example: #king_hual,#scripters,#jane
    }
  }
}
« Last Edit: February 11, 2011, 06:26:01 pm by Jane »

Share on Bluesky Share on Facebook


Jane

  • Management
  • Full
  • *******
  • Posts: 130
  • Reputation +1/-0
  • mIRC Scripters
    • View Profile
Re: Basic bot control snippets (!join | !part)
« Reply #1 on: February 11, 2011, 06:27:47 pm »
Simple and nice script.