Hashtable Binding Script
Posted by Log1x
Friday, March 30, 2007
Description: Made by Log1x for Log1xBot

Pretty much this is a simple script that allows you to bind things and you can modify it to your needs. The trigger depends on the variable %trigger so you can change that around if you wish. It uses hashtables and saves as binds.db. If %trigger == $null it will make the trigger default @.

The commands that are included are:
binds - Shows all of the commands you have binded.
bind - Binds a command. (Also can be used to change a current bind.)
unbind - Unbinds a command.

If you need any help message Log1x @ irc.GameSurge.net. You can also join #Log1x and contact me also.

<mirc>

on *:TEXT:*:#:{
  if ($hget(binds) == $null) {
    hmake binds
    if ($exists(binds.db) == $true) {
      hload binds binds.db
    }
  }
  if (!%trigger) { var %trigger = @ }
  if ($mid($1-,1,$len(%trigger)) == %trigger) {
    tokenize 32 $mid($1-,$calc($len(%trigger) + 1) $+ -)
  }
  else { halt }
  if ($hget(binds,$1) != $null) {
    .msg $chan $v1
  }
  if ($ulevel >= 5) {
    if ($1 == bind) {
      if ($3 == $null) { notice $nick Specify [command] [text] }
      else {
        hadd binds $2 $2 $+ : $3-
        .notice $nick Binded $2 to $3-
        hsave binds binds.db
      }
    }
  }
if ($ulevel >= 5) {
if ($1 == binds) {
    unset %n | unset %b | set %n 1
    while (%n <= $lines(binds.db)) {
      set %b %b %trigger $+ $read(binds.db,%n)
    inc %n 2 }
  .msg $chan Binds: %b
}
}
  if ($ulevel >= 5) {
    if ($1 == unbind) {
      if ($2 == $null) { notice $nick Specify [command] }
      else {
        if ($hget(binds,$2) == $null) { Notice $nick $2 }
        else {
          hdel binds $2
          .notice $nick Successfully unbinded $+($2,.)
          hsave binds binds.db
        }
      }
    }
  }
}
By the way
Posted by Log1x
Friday, March 30, 2007 02:12pm PDT
To be able to use this, you need to have your user level as 5.

ex. 5:*!*@Log1x.loves.Milon

You can set that in ALT+R (Script Editor) and in the users tab.
Good work
Posted by Tony
Tuesday, May 29, 2007 02:58pm PDT
Very nice scripting there. I use it for my bot, but I editted alittle bit.
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world