mIRC Home    About    Download    Register    News    Help

Print Thread
#119301 04/05/05 12:33 AM
Joined: Apr 2005
Posts: 30
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2005
Posts: 30
Well, as Andy knows, I have been working on this script but there seems to be an error... I have made a seperate timer for WinAmp Idle (Basic Idle works fine) and when I type !idle state it will display WinAmp Idle off, even though it has been turned on. Also, the alias for turning the script on /idlewa <"on"|"off"> doesnt work either. Can anyone help?

Code:
; –––––––––––––––––––––––––––––––––––––––––––––––+
; IdleScript v1.7                                |
; © 2005 by Forgotten (Justin)                   |
; Remember - ripping is lame                     |
; Visit www.pyro-studios.com                     |
; hellfire.redirectme.net 6667 #pyro             |
; –––––––––––––––––––––––––––––––––––––––––+–––––+
;  Special Thanks to SladeKraven (Andy)    |
; -----------------------------------------+


; ---------------
;  BEGIN REMOTES
; ---------------

on *:load:{
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
  echo -a IdleScript v1.7
  echo -a © 2005 by Forgotten (Justin)
  echo -a Visit www.pyro-studios.com
  echo -a hellfire.redirectme.net 6667 #pyro
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
  echo -a Read the commands.txt for commands or type !idle help
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
}
on 100:TEXT:!idle *:#: { 

  ; Basic Idle is turned on
  if ($2 == on) {
    if (%idlemsg == on) { msg $chan Already enabled. | halt }
    idlemsg on idlealias
    set %idlemsg on
    msg $chan Enabled.
  }

  ; WinAmp Idle or Basic Idle is turned off
  if ($2 == off) { 
    if (%idlemsg == off) {
      if (%idlewinamp == off) { msg $chan Already disabled. | halt }
      idlewinamp off
      set %idlewinamp off
      msg $chan WinAmp Idle Disabled.
      halt
    }
    idlemsg off
    set %idlemsg off
    msg $chan Disabled.
  }

  ; displays current config in channel
  if ($2 == state) {
    if (idlewinamp == on) {
      msg $chan WinAmp Idle: on -=- Time Remaining: $duration($timer(idlemsg).secs) -=- Time Set: %myidletimer
      halt
    }
    msg $chan Idle State: %idlemsg -=- Time Remaining: $duration($timer(idlemsg).secs) -=- Time Set: %myidletimer
  }

  ; remotely sets time
  if ($2 == set) {
    if ($3 == $null) {
      msg $chan Provide a value
      halt
    }
    if ($4 == winamp) {
      set %myidletimer $3
      msg $chan Value set to: %myidletimer seconds for WinAmp Idle
      idlewinamp on
      halt
    }
    set %myidletimer $3
    msg $chan Value set to: %myidletimer seconds
    idlemsg on idlealias
    set %idlemsg on
  }

  ; remotely sets idle msg
  if ($2 == msg) {
    ; turns WinAmp Idle on or off (AMIP REQUIRED)
    if ($3 == winamp) {
      if (%idlewinamp == on) { msg $chan Already enabled. | halt }
      idlemsg off
      idlewinamp on
      msg $chan WinAmp Idle Enabled.
      halt
    }
    if ($3 == $null) {
      msg $chan Provide a message
      halt
    }
    msg $chan Value set to: $+(',$$3-,')
    set %myidlezz $$3-
  }

  ; displays msg in channel
  if ($2 == display) {
    idlealias
  }

  ; remotely sets channel
  if ($2 == chan) {
    if ($3 == $null) {
      msg $chan Provide a channel
      halt
    }
    set %myidlemsg2 $3
    msg $chan Channel: %myidlemsg2
  }

  ; messages user with commands
  if ($2 == help) {
    msg $nick 7,1[ !idle on: turns script on -=- !idle off: turns script off -=- !idle set &lt;value&gt;: sets time delay (in secs) -=- !idle state: displays info -=- !idle display: shows msg -=- !idle chan &lt;channel&gt;: set the channel the bot idles ]
  }
}

; Basic Timer
alias idlemsg {
  if ($1 == on) { .timeridlemsg 0 %myidletimer $$2- }
  if ($1 == off) { .timeridlemsg off }
}

; WinAmp Timer
alias idlewinamp {
  if ($1 == on) { .timeridlemsg 0 %myidletimer /dde mplug announce }
  if ($1 == off) { .timeridlemsg off }
}

; Where the msg is assembled
alias idlealias {
  %myidlemsg %myidlemsg2 %myidlezz
}


; ---------------
;  BEGIN ALIASES
; ---------------

; displays the state
alias /idlestate { 
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
  echo -a Idle State: %idlemsg -=- Time Remaining: $duration($timer(idlemsg).secs) -=- Time Set: %myidletimer
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
}

; turns script on
alias /idleon { 
  idlemsg on idlealias
  set %idlemsg on
  msg $chan Enabled.
}

; turns script off
alias /idleoff { 
  idlemsg off
  set %idlemsg off
  msg $chan Disabled.
}

; sets timer via field
alias /idleset { 
  set %myidletimer $input(Provide Wait Time. 1 = 1 second,129)
  echo -a Time Interval Set To: %myidletimer
  idlemsg on idlealias
  set %idlemsg on
}

; sets msg via field
alias /idlemsg { 
  set %myidlemsg $input(Enter In Idle Message,129)
  echo -a Idle Msg Set To: %myidlezz
  idlemsg on idlealias
  set %idlemsg on
}

; sets channel via field
alias /idlechan {
  set %myidlemsg2 $input(Enter In Channel,129)
  msg $chan Channel: %myidlemsg2
}

; displays current msg
alias /idledisplay {
  echo -a %myidlezz
}

; turns WinAmp Idle on or off (AMIP REQUIRED)
alias /idlewa {
  if ($2 == on) {
    if (%idlewinamp == on) { msg $chan Already enabled. | halt }
    idlemsg off
    idlewinamp on
    echo -a WinAmp Idle Enabled.
    msg $chan WinAmp Idle Enabled.
  }
  if ($2 == off) {
    if (%idlewinamp == off) { msg $chan Already disabled. | halt }
    idlewinamp off
    set %idlewinamp off
    echo -a WinAmp Idle Disabled.
    msg $chan WinAmp Idle Disabled.
  }
}

; --------------------------------------
;  Special Thanks to SladeKraven (Andy)
; --------------------------------------


Yes andy! I gave you credit!


mIRC Newb. smile
Joined: Apr 2005
Posts: 30
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2005
Posts: 30
also,

I thought you should know the variables:

My Current Settings:
%myidletimer 1800
%myidlemsg msg
%myidlemsg2 #mychannel
%myidlezz This Is My Idle Message!
%myidlewinamp /dde mplug announce

Explanations:
%myidletimer is the amount of seconds between a message
%myidlemsg is "msg" before the channel is mentioned
%myidlemsg2 is where the channel that gets messaged
%myidlezz is the message its self
%myidlewinamp is for displaying the WinAmp Idle using AMIP


mIRC Newb. smile
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Heres what i noticed.

if (idlewinamp == on) {
^ % missing, add it in

alias idlemsg {
alias /idlemsg {
^ duplicate alias definitions, rename the second one, (side note / are not needed in the alias name definition and are ignored)

if ($2 == on) {
if ($2 == off) {
^ $2 should be $1, fix it

if (%idlewinamp == on) { msg $chan Already enabled. | halt }
msg $chan WinAmp Idle Enabled.
if (%idlewinamp == off) { msg $chan Already disabled. | halt }
msg $chan WinAmp Idle Disabled.
^ Since you can run an alais from anywhere the $chan value may not have a value, this could cause the script to send to a user named 'Already' or 'Winamp'
Suggested correction.
if (%idlewinamp == on) { if $chan { msg $chan Already enabled. } | halt }
if $chan { msg $chan WinAmp Idle Enabled. }
if (%idlewinamp == off) { if $chan { msg $chan Already disabled. } | halt }
if $chan { msg $chan WinAmp Idle Disabled. }

Joined: Apr 2005
Posts: 30
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2005
Posts: 30
I have many bits like these, could you post the corrections on the modified code and have them bold? please and thankyou


mIRC Newb. smile
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Bold dont work so well in code blocks so i made em blue

Code:
; –––––––––––––––––––––––––––––––––––––––––––––––+
; IdleScript v1.7                                |
; © 2005 by Forgotten (Justin)                   |
; Remember - ripping is lame                     |
; Visit www.pyro-studios.com                     |
; hellfire.redirectme.net 6667 #pyro             |
; –––––––––––––––––––––––––––––––––––––––––+–––––+
;  Special Thanks to SladeKraven (Andy)    |
; -----------------------------------------+


; ---------------
;  BEGIN REMOTES
; ---------------

on *:load:{
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
  echo -a IdleScript v1.7
  echo -a © 2005 by Forgotten (Justin)
  echo -a Visit www.pyro-studios.com
  echo -a hellfire.redirectme.net 6667 #pyro
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
  echo -a Read the commands.txt for commands or type !idle help
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
}
on 100:TEXT:!idle *:#: { 

  ; Basic Idle is turned on
  if ($2 == on) {
    if (%idlemsg == on) { msg $chan Already enabled. | halt }
    idlemsg on idlealias
    set %idlemsg on
    msg $chan Enabled.
  }

  ; WinAmp Idle or Basic Idle is turned off
  if ($2 == off) { 
    if (%idlemsg == off) {
      if (%idlewinamp == off) { msg $chan Already disabled. | halt }
      idlewinamp off
      set %idlewinamp off
      msg $chan WinAmp Idle Disabled.
      halt
    }
    idlemsg off
    set %idlemsg off
    msg $chan Disabled.
  }

  ; displays current config in channel
  if ($2 == state) {
    if ([color:blue]%[/color]idlewinamp == on) {
      msg $chan WinAmp Idle: on -=- Time Remaining: $duration($timer(idlemsg).secs) -=- Time Set: %myidletimer
      halt
    }
    msg $chan Idle State: %idlemsg -=- Time Remaining: $duration($timer(idlemsg).secs) -=- Time Set: %myidletimer
  }

  ; remotely sets time
  if ($2 == set) {
    if ($3 == $null) {
      msg $chan Provide a value
      halt
    }
    if ($4 == winamp) {
      set %myidletimer $3
      msg $chan Value set to: %myidletimer seconds for WinAmp Idle
      idlewinamp on
      halt
    }
    set %myidletimer $3
    msg $chan Value set to: %myidletimer seconds
    idlemsg on idlealias
    set %idlemsg on
  }

  ; remotely sets idle msg
  if ($2 == msg) {
    ; turns WinAmp Idle on or off (AMIP REQUIRED)
    if ($3 == winamp) {
      if (%idlewinamp == on) { msg $chan Already enabled. | halt }
      idlemsg off
      idlewinamp on
      msg $chan WinAmp Idle Enabled.
      halt
    }
    if ($3 == $null) {
      msg $chan Provide a message
      halt
    }
    msg $chan Value set to: $+(',$$3-,')
    set %myidlezz $$3-
  }

  ; displays msg in channel
  if ($2 == display) {
    idlealias
  }

  ; remotely sets channel
  if ($2 == chan) {
    if ($3 == $null) {
      msg $chan Provide a channel
      halt
    }
    set %myidlemsg2 $3
    msg $chan Channel: %myidlemsg2
  }

  ; messages user with commands
  if ($2 == help) {
    msg $nick 7,1[ !idle on: turns script on -=- !idle off: turns script off -=- !idle set &lt;value&gt;: sets time delay (in secs) -=- !idle state: displays info -=- !idle display: shows msg -=- !idle chan &lt;channel&gt;: set the channel the bot idles ]
  }
}

; Basic Timer
alias idlemsg {
  if ($1 == on) { .timeridlemsg 0 %myidletimer $$2- }
  if ($1 == off) { .timeridlemsg off }
}

; WinAmp Timer
alias idlewinamp {
  if ($1 == on) { .timeridlemsg 0 %myidletimer /dde mplug announce }
  if ($1 == off) { .timeridlemsg off }
}

; Where the msg is assembled
alias idlealias {
  %myidlemsg %myidlemsg2 %myidlezz
}


; ---------------
;  BEGIN ALIASES
; ---------------

; displays the state
alias /idlestate { 
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
  echo -a Idle State: %idlemsg -=- Time Remaining: $duration($timer(idlemsg).secs) -=- Time Set: %myidletimer
  echo -a ו•••••••••••••••••••••••••••••••••• ••••• ••• •• •• •• •  •
}

; turns script on
alias /idleon { 
  idlemsg on idlealias
  set %idlemsg on
  msg $chan Enabled.
}

; turns script off
alias /idleoff { 
  idlemsg off
  set %idlemsg off
  msg $chan Disabled.
}

; sets timer via field
alias /idleset { 
  set %myidletimer $input(Provide Wait Time. 1 = 1 second,129)
  echo -a Time Interval Set To: %myidletimer
  idlemsg on idlealias
  set %idlemsg on
}

; sets msg via field
alias /idlemsg[color:blue]set[/color] { 
  set %myidlemsg $input(Enter In Idle Message,129)
  echo -a Idle Msg Set To: %myidlezz
  idlemsg on idlealias
  set %idlemsg on
}

; sets channel via field
alias /idlechan {
  set %myidlemsg2 $input(Enter In Channel,129)
  msg $chan Channel: %myidlemsg2
}

; displays current msg
alias /idledisplay {
  echo -a %myidlezz
}

; turns WinAmp Idle on or off (AMIP REQUIRED)
alias /idlewa {
  if ($2 == on) {
    if (%idlewinamp == on) { [color:blue]if $chan { msg $chan Already enabled. }[/color] | halt }
    idlemsg off
    idlewinamp on
    echo -a WinAmp Idle Enabled.
    [color:blue]if $chan { msg $chan WinAmp Idle Enabled. }[/color]
  }
  if ($2 == off) {
    if (%idlewinamp == off) { [color:blue]if $chan { msg $chan Already disabled. }[/color] | halt }
    idlewinamp off
    set %idlewinamp off
    echo -a WinAmp Idle Disabled.
    [color:blue]if $chan { msg $chan WinAmp Idle Disabled. }[/color]
  }
}

; --------------------------------------
;  Special Thanks to SladeKraven (Andy)
; --------------------------------------

Joined: Apr 2005
Posts: 30
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2005
Posts: 30
even though you fixed some errors, both problems I listed still exist...


mIRC Newb. smile
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I suggest you go and flow diagram what you want it to do, i can see several places where you activare one or the other of the timers without diabling the other and/or setting the variables that telll you which one is enabled.

ie:
idlemsg off
idlewinamp on

but no

set %idlemsg off
set %idlewinamp on


Specificly i can state you have NO "set %idlewinamp on" anywhere in the code so the !idle state well never match the "on" position IF statement.

Joined: Apr 2005
Posts: 30
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2005
Posts: 30
still doesn't work! T__T


mIRC Newb. smile
Joined: Apr 2005
Posts: 30
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2005
Posts: 30
come on, no one knows how to fix this?


mIRC Newb. smile
Joined: Apr 2005
Posts: 30
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2005
Posts: 30
bump


mIRC Newb. smile
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
What doesn't work dude, I can't make any promises I'll be able to sort it because I'm extremely tired it's nearly 3am here but I'll try and try some more in the morning when I've got a more clearer head.

-Andy


Link Copied to Clipboard