Botscript / Userlist, examples to use the userlist.

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

Botscript / Userlist, examples to use the userlist.

Postby Cristian » Mon Dec 03, 2007 3:22 pm

Code: Select all
;bare skriv hello botnick, så vil du automatisk blive added som owner som kan: 

; Owner - kan nedestående
;  .addmaster <nick>
;  .remaster <nick>|<*!*@host>

; Master - kan nedestående
;  .addadmin <nick>
;  .remadmin <nick|<*!*@host>

; Admin - kan nedestående
;  .addop <nick>
;  .remop <nick>|<*!*@host>

; Op - kan nedestående
;  .addvoice <nick>
;  .remvoice <nick>|<*!*@host>


on *:TEXT:*:#:{   
  if (hello $me == $1-2) && (!$hget(global,$wildsite)) { hadd -m Global $wildsite Owner | .notice $nick Hello $nick $+ , you are now added as Global Owner }
  if ($hget(global,$wildsite) == Owner) {     
    if ($1 == .addmaster) && ($2) { hadd -m $chan $address($2,2) Master | .notice $nick Added $2 to userlevel as Master }
    if ($1 == .remmaster) && ($2) {       
      if (! isin $2) { hdel $chan $2 | .notice $nick Removed $2 from userlevel }       
      elseif (! !isin $2) { hdel $chan $address($2,2) | .notice $nick Removed $2 from userlevel }
    }
    if ($1 == .addadmin) && ($2) { hadd -m $chan $address($2,2) Admin | .notice $nick Added $2 to userlevel as Admin }
    if ($1 == .remadmin) && ($2) { 
      if (! isin $2) { hdel $chan $2 | .notice $nick Removed $2 from userlevel }
      elseif (! !isin $2) { hdel $chan $address($2,2) | .notice $nick Removed $2 from userlevel }
    }
    if ($1 == .addop) && ($2) { hadd -m $chan $address($2,2) Op | .notice $nick Added $2 to userlevel as Op }
    if ($1 == .remop) && ($2) { 
      if (! isin $2) { hdel $chan $2 | .notice $nick Removed $2 from userlevel }
      elseif (! !isin $2) { hdel $chan $address($2,2) | .notice $nick Removed $2 from userlevel }
    }
    if ($1 == .addvoice) && ($2) { hadd -m $chan $address($2,2) Voice | .notice $nick Added $2 to userlevel as Voice }
    if ($1 == .remvoice) && ($2) { 
      if (! isin $2) { hdel $chan $2 | .notice $nick Removed $2 from userlevel }
      elseif (! !isin $2) { hdel $chan $address($2,2) | .notice $nick Removed $2 from userlevel }
    }
    if ($1 == .part) && ($chr(35) isin $2) && ($chr(44 !isin $2) { if ($me ison $2) { .part $2 } | hfree $2 }
    if ($1 == .join) && ($chr(35) isin $2) && ($chr(44 !isin $2) { .join $2 }
  }
  if ($hget($chan,$wildsite) == Master) {
    if ($1 == .addop) && ($2) { hadd -m $chan $address($2,2) Op | .notice $nick Added $2 to userlevel as Op }
    if ($1 == .remop) && ($2) { 
      if (! isin $2) { hdel $chan $2 | .notice $nick Removed $2 from userlevel }
      elseif (! !isin $2) { hdel $chan $address($2,2) | .notice $nick Removed $2 from userlevel }
    }
    if ($1 == .addvoice) && ($2) { hadd -m $chan $address($2,2) Voice | .notice $nick Added $2 to userlevel as Voice }
    if ($1 == .remvoice) && ($2) { 
      if (! isin $2) { hdel $chan $2 | .notice $nick Removed $2 from userlevel }
      elseif (! !isin $2) { hdel $chan $address($2,2) | .notice $nick Removed $2 from userlevel }
    }
  }
  if ($hget($chan,$wildsite) == Op) {
    if ($1 == .addvoice) && ($2) { hadd -m $chan $address($2,2) Voice | .notice $nick Added $2 to userlevel as Voice }
    if ($1 == .remvoice) && ($2) { 
      if (! isin $2) { hdel $chan $2 | .notice $nick Removed $2 from userlevel }
      elseif (! !isin $2) { hdel $chan $address($2,2) | .notice $nick Removed $2 from userlevel }
    }
  }
  if (.lvl == $1) && ($hget($chan,$wildsite)) { .notice $nick your lvl for $chan is $hget($chan,$wildsite) }
}

; nogle exempler på hvad du kan lave

on @*:JOIN:#:{
  if ($hget($chan,$wildsite) == Master) || ($hget($chan,$wildsite) == Admin) || ($hget($chan,$wildsite) == Op) { .raw -q MODE $chan +o $nick }
  elseif ($hget($chan,$wildsite) == Voice) { .raw -q MODE $chan +v $nick }
}


on @*:KICK:#:{ 
  if (!$hget($chan,$wildsite)) { 
    if (!$hget(offence,$+(kick.,$wildsite,.,$chan))) { hadd -mu3 offence $+(kick.,$wildsite,.,$chan) 1 }
    else { hinc -mu3 offence $+(kick.,$wildsite,.,$chan) 1 }
    if ($hget(offence,$+(kick.,$wildsite,.,$chan)) == 1) {
      .raw -q MODE $chan -o+b $nick $wildsite $+ $crlf $+ KICK $chan $nick :msg 
    }
  }
}
on @*:BAN:#:{ 
  if (!$hget($chan,$wildsite)) { 
    if (!$hget(offence,$+(ban.,$wildsite,.,$chan))) { hadd -mu3 offence $+(ban.,$wildsite,.,$chan) 1 }
    else { hinc -mu3 offence $+(ban.,$wildsite,.,$chan) 1 }
    if ($hget(offence,$+(ban.,$wildsite,.,$chan)) == 1) {
      .raw -q MODE $chan -ob+b $nick $banmask $wildsite $+ $crlf $+ KICK $chan $nick :msg 
    } 
  }
}
on @*:DEOP:#:{ 
  if (!$hget($chan,$wildsite)) { 
    if (!$hget(offence,$+(deop.,$wildsite,.,$chan))) { hadd -mu3 offence $+(deop.,$wildsite,.,$chan) 1 }
    else { hinc -mu3 offence $+(deop.,$wildsite,.,$chan) 1 }
    if ($hget(offence,$+(deop.,$wildsite,.,$chan)) == 1) {
      .raw -q MODE $chan -o+bo $nick $banmask $wildsite $opnick $+ $crlf $+ KICK $chan $nick :msg 
    }
  }
}
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Return to Mirc Scripting Release

Who is online

Users browsing this forum: No registered users and 0 guests