mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
confused confused confused confused confused

Another Problem with my code:

#antiidle on
alias anti.on {
if (%idle != on) {
set %idle on
echo -a Anti Idle Is On
}
else {
echo -a Anti Idle is Already
}
}
alias idle.off {
if (%idle != off) {
set %idle off
echo -a Anti Idle Is Off
}
else {
echo -a Anti idle Is Already Off.
}
}
on *:Connect: { .timeridle 0 1 anti }
alias anti {
if (($idle >= 1 ) && (%idle = on)) {
/msg $me ...
/resetidle 1
}
}
#antiidle end

once on, it will work perfectly, but if i uncheck the tickbox, there is this error...

· · Error : /anti is an unknown command

Now that is repeated every second, please help.

confused confused confused confused confused


sub-zero.homeip.net:6667

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hi Skeletor, I just made a slight alteration in your script.

You had anti.on and idle.off, so I changed it to anti.off just incase that was causing it.

[code]
#antiidle on
alias anti.on {
if (%idle != on) {
set %idle on
echo -a Anti Idle is on.
}
else {
echo -a Anti Idle is already on.
}
}

alias anti.off {
if (%idle != off) {
set %idle off
echo -a Anti Idle is off.
}
else {
echo -a Anti Idle is already off.
}
}

on *:Connect: {
.timeridle 0 1 anti
}

alias anti {
if (($idle >= 1 ) && (%idle = on)) {
msg $me ...
resetidle 1
}
}
#antiidle end

Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Nope, no joy mate, this is getting the better of me now, does that script work on your side?

:Added:

its seems if i use /anti.on and /anti.off the script works 100%, but its when i use the check box through a dialog window i made, here is the code for the dialog window:

Taken from the Dialog: check "Anti-Idle", 2, 5 12 50 10

The "on" statement:

on *:dialog:Prot:sclick:2:{
if ($did(2).state == 0) { /disable #antiidle | echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle OFF. 1,3 4,1V1,3TEC 4,1§1,3cript® }
elseif ($did(2).state == 1) { /enable #antiidle | echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle ON. 1,3 4,1V1,3TEC 4,1§1,3cript® }
}

And the init:

on *:Dialog:Prot:init:0: {
if ($group(#antiidle) == on) { did -c $dname 2 }
}

Last edited by Skeletor; 28/02/05 12:26 PM.

sub-zero.homeip.net:6667

Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Right i cracked it!!!!

here was the problem:

on *:Dialog:Prot:init:0: {

if ($group( #anti.on ) == on) { did -c $dname 2 }

on *:dialog:Prot:sclick:2:{
if ($did(2).state == 0) { /anti.off | echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle OFF. 1,3 4,1V1,3TEC 4,1§1,3cript® }
elseif ($did(2).state == 1) { /anti.on | echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle ON. 1,3 4,1V1,3TEC 4,1§1,3cript® }
}

#anti.on
alias anti.on {
if (%idle != on) {
set %idle on
echo -a Anti Idle Is On.
}
else {
echo -a Anti Idle Is Already On.
}
}

alias anti.off {
if (%idle != off) {
set %idle off
echo -a Anti Idle Is Off.
}
else {
echo -a Anti Idle Is Already Off.
}
}

on *:Connect: {
.timeridle 0 1 anti
}

alias anti {
if (($idle >= 1 ) && (%idle = on)) {
msg $me ...
resetidle 1
}
}
#anti.on end

/me buys SladeKraven A Cold One. /timer 0 2 LOL

Last edited by Skeletor; 28/02/05 12:40 PM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Way to go, dude. smile

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Make it a cold diet coke please dude, my 18th isn't till March 22nd lol.

Last edited by SladeKraven; 28/02/05 12:42 PM.
Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Hey...gues what?...It me again...

on *:dialog:Prot:sclick:2:{
if ($did(2).state == 0) { /anti.off | echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle OFF. 1,3 4,1V1,3TEC 4,1§1,3cript® | /closemsg $me /time 0 2 }
elseif ($did(2).state == 1) { /anti.on | echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle ON. 1,3 4,1V1,3TEC 4,1§1,3cript® }
}

The above is what i am using now, now it works perfectly, but when is select the check box, then close it the dialog, then reopen it, then Check box is no longer selected.

on *:dialog:Prot:sclick:2:{
if ($did(2).state == 0) { /disable #anti | echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle OFF. 1,3 4,1V1,3TEC 4,1§1,3cript® | /closemsg $me /time 0 2 }
elseif ($did(2).state == 1) { /enable #anti | echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle ON. 1,3 4,1V1,3TEC 4,1§1,3cript® }
}

This will also work but with the error /anti unknown command, but the check box will stay ticked.


sub-zero.homeip.net:6667

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Vars should do the trick, this is the above code you specified but just modified using VARS.

Code:
on *:dialog:Prot:sclick:2:{
  if ($did(2).state == 0) { 
    anti.off 
    echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle OFF. 1,3 4,1V1,3TEC 4,1§1,3cript® 
    set %anti 0
    closemsg $me 
    /time 0 2 
  }
  elseif ($did(2).state == 1) { 
    anti.on 
    echo -a 1,3 4,1V1,3TEC 4,1§1,3cript® 8,4 Anti-Idle ON. 1,3 4,1V1,3TEC 4,1§1,3cript® 
    set %anti 1
  }
}

on 1:Dialog:Prot:init:0: {
  if (%anti == 1) { did -c Prot 2 }
}

Joined: Feb 2005
Posts: 185
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Feb 2005
Posts: 185
Thankx a Million Mate

* Skeletor Buys SladeKraven an Ice Cold Diet [color:red] Coke

Last edited by Skeletor; 01/03/05 03:47 PM.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're welcome mate. smile

* Andy gulps the diet coke. Thanks!

Nothing like a diet coke break. wink

Page 2 of 2 1 2

Link Copied to Clipboard