mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2014
Posts: 36
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jul 2014
Posts: 36
This script isn't being recognized for some reason...

My whole goal is to give everyone 1 point every 30 minutes.

http://puu.sh/bt58V/b20d975339.png

How do I fix this?

Here is what I have in

Alias:
Code:
alias awardpoints {
  var %chan = $$1, %table = coins. $+ %chan, %file = coins.ini

  if (!$hget(%table)) {
    hmake %table
    if ($ini(%file,%chan)) hload -i %table %file %chan
  }

  var %i = 1, %n = $nick(%chan,0)
  while (%i <= %n) {
    hinc %table $nick(%chan,%i)
    inc %i
  }

  hdel %table nightbot
  hdel %table tylerb0t
  hdel %table tylersgaming

  hsave -i %table %file %chan
}


Remote:
Code:
on *:connect: {
  if ($me != tylersgaming) && ($right($server,18) == .speedrunslive.com) {
    ns ghost tylersgaming xxx
    nick tylersgaming
    ns identify xxx
  }
  if ( $me == tylersgaming ) && ($right($server,18) == .speedrunslive.com) {
    ns identify xxx
  }
}


on *:TEXT:!on*:#:{
  if ($nick == tylersgaming) {
    if ($read(botstatus.txt,t,1) == on) {

    }
    if ( $read(botstatus.txt,t,1) == off) {
      /write -c botstatus.txt
      /timerAward 0 1800 /awardPoints $chan
      write botstatus.txt on
      msg $chan Points will now be awarded.
    }
  }
}

on *:TEXT:!off*:#:{
  if ($nick == tylersgaming) {
    if ($read(botstatus.txt,t,1) == off) {

    }
    if ( $read(botstatus.txt,t,1) == on) {
      /write -c botstatus.txt
      write botstatus.txt off
      /timerAward off
      msg $chan Points will no longer be awarded.
    }
  }
}

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Try using this code , remove the old and paste the new one.

Alias:

Code:
alias awardpoints {
  if (!$1) { return }
  if ($status !== connected) { return }
  if ($1 !ischan) { return }
  var %chan = $1
  var %table = coins_ $+ %chan
  var %file = coins.ini
  if (!$hget(%table)) {
    hmake %table 500
    if ($ini(%file,%chan)) hload -i %table $qt(%file) %chan
  }
  var %t = $nick(%chan,0)
  var %i = 1
  while (%i <= %t) {
    var %n = $nick(%chan,%i)
    if (%n == nightbot) { goto next }
    if (%n == tylerb0t) { goto next }
    if (%n == tylersgaming) { goto next }
    hinc %table $nick(%chan,%i)
    :next
    inc %i
  }
  if ($hget(%table)) { hsave -i %table $qt(%file) %chan }
}


Remote:

Code:

ON *:CONNECT: {
  if ($me != tylersgaming) && (*.speedrunslive.com* iswm $server) {
    .msg NickServ ghost tylersgaming xxx
    nick tylersgaming
    .msg NickServ identify xxx
  }
  elseif ($me == tylersgaming) && (*.speedrunslive.com* iswm $server) { .msg NickServ identify xxx }
}

ON *:TEXT:!*:#: {
   if ($nick !== tylersgaming) { return }
  var %f = $mircdirbotstatus.txt
  if ($1 == !on) {
    var %st = $read(botstatus.txt,nt,1)
    if (!%st) { goto create }
    if (%st == on) { msg $chan [ $+ $nick $+ ]: Points are already awarded. }
    elseif (%st == off) {
      :create
      .timerAward 0 10 awardpoints $chan
      write -dl1 $qt(%f) on
      msg $chan [ $+ $nick $+ ]: Points will now be awarded.
    }
  }
  if ($1 == !off) {
    var %st = $read(botstatus.txt,nt,1)
    if (!%st) { goto create2 }
    if (%st == off) { msg $chan [ $+ $nick $+ ]: Points are already no longer been awarded. }
    elseif (%st == on) {
      :create2
      write -dl1 $qt(%f) off
      .timerAward off
      msg $chan [ $+ $nick $+ ]: Points will no longer be awarded.
    }
  }
}


NOTE: This code is working only for ONE CHANNEL! tell me if you want multi-channel working support.

- Thanks!


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
There was nothing wrong with the original awardpoints alias. I use /hdel after the loop because it's faster than comparing nicks thousands of times.

Edit: Because he's differentiated the code by "alias" and "remote" I'm guessing he has the alias in the alias section of the editor. It should be in remote. His PM showed "awardpoints unknown command".

Last edited by Loki12583; 10/09/14 11:54 AM.
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Originally Posted By: Loki12583
There was nothing wrong with the original awardpoints alias. I use /hdel after the loop because it's faster than comparing nicks thousands of times.


Ok i thought it was an problem in the code so i redesign it, yes your way sure is faster.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jul 2014
Posts: 36
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jul 2014
Posts: 36
thanks so much for the help, I sent you a pm to clarify the problem.


Joined: Jul 2014
Posts: 36
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jul 2014
Posts: 36
also sorry for your work on that code, I won't use it but I appreciate it.


Link Copied to Clipboard