Auto Hop All Channels

By ProIcons on Mar 30, 2010

With this script you can set an auto hop on all channels you are this time every "x" seconds

Commands:
/autohop set Time (in seconds)
/autohop on
/autohop off

alias hopall {
  var %i 1, %x
  while (%i <= $chan(0)) {
    %x = $addtok(%x, $chan(%i), 44)
    inc %i
  }
  .partall $1-
  .timer 1 0 join -n %x
}
alias autohop {
  if ($1 == on) {
    if (%hoptime) {
      .timer[autohop] 0 %hoptime hopall
      set %autohop on
      echo $color(info) * Auto Hop All Channels is now On, on %hoptime Second(s)
    }
    else { echo $color(info) * Auto Hop All Channels time is not seted, set it with: /autohop set <time> }
  }
  elseif ($1 == off) {
    .timer[autohop] off
    echo $color(info) * Auto Hop All Channels is now OFF
    set %autohop off
  }
  elseif ($1 == set) {
    if ($2 isnum) {
      set %hoptime $2
      echo $color(info) * Auto Hop All Channels time seted to: $2 second(s)
      if (%autohop == on) {
        .timer[autohop] off
        .timer[autohop] 0 %hoptime hopall
        echo $color(info) * Auto Hop All Channels was on, Script Reloaded %hoptime starting to count from now
      }
    }
    else {
      echo $color(info) * /autohop: insufficient parameters
    }

  }
  else {
    echo $color(info) * /autohop: insufficient parameters
  }
}

Comments

Sign in to comment.
ProIcons   -  Mar 30, 2010

i've made it in one minute just for one of my friends and i posted here for all you:P but anyway thx for the advises:)

 Respond  
Jethro   -  Mar 30, 2010

Yeah Scakk's example is short and to the point. And it can be modified to add an on/off switch, along with a timer to it.

 Respond  
WorldDMT   -  Mar 30, 2010

hi
you can group the two conditions ON and OFF together with a $istok
and if the timer is running you need not put off then restart just remade it
for the first error is about syntax not insufficient parameters so your code can be like this

alias hopall {
  .partall $1-
  join -n $regsubex($str(.,$chan(0)),/./g,$+($chan(\n),$chr(44)))
}
alias autohop {
  if $istok(on.off,$1,46) {
    if %hoptime {
      .timer[autohop] $iif($1 == on,0 %hoptime hopall,off)
      set %autohop $1
      echo $color(info) * Auto Hop All Channels is now $1 $+ $iif($1 == on,$chr(44) on %hoptime Second(s))
    }
    else echo $color(info) * Auto Hop All Channels time is not seted, set it with: /autohop set <time>
  }
  elseif $1 == set {
    if $2 isnum {
      set %hoptime $2
      if (%autohop == on) .timer[autohop] 0 %hoptime hopall
      echo $color(info) * Auto Hop All Channels $iif($v1 == on,was on $+ $chr(44) Script Reloaded %hoptime starting to count from now,time seted to: %hoptime second(s))
    }
    else echo $color(info) * /autohop: Error syntax - /autohop set <time>
  }
  else echo $color(info) * /autohop: insufficient parameters
}
 Respond  
Scakk   -  Mar 30, 2010

For your hopall alias you could do the below to get the same thing.

alias hopp { var %t 1 | while (%t <= $chan(0)) { hop -c $chan(%t) $iif($1,$1-) | inc %t } }
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.