mIRC Home    About    Download    Register    News    Help

Print Thread
Activate , unactivate a script #151899 23/06/06 01:28 AM
Joined: Jun 2005
Posts: 37
A
Armymen Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Jun 2005
Posts: 37
i got that code
Code:
;;;;;;;;;;;
; Anti-PV ;
;;;;;;;;;;;

on ^*:OPEN:?:{ 
  haltdef 
  .msg $nick [Auto Msg] 12!8*12!0!!4!! 9Bonjours, j'utilise un anti-Pv, si j'ai le temps, Je vais vous répondre sous peu 4:11-4)
  .ignore -pu $nick 300 
  .timer 1 0 anti-pv $nick $1- 
} 
alias anti-pv { 
  set %anti-pv.nick $1 
  set %anti-pv.msg $2- 
  if ($?!="Privé de %anti-pv.nick $+ , accepter ? $crlf $+ Message: %anti-pv.msg ") { 
    .msg %anti-pv.nick [Auto Msg] Demande de privé accepté \o/ Bonjours sa va ?
    .ignore -r $nick 
    .query %anti-pv.nick 
    .notice $me %anti-pv.msg
  } 
  else { 
    .msg %anti-pv.nick [Auto Msg] Demande de privé refusé dsl :( ! 
  } 
} 
  

first i add that : .notice $me %anti-pv.msg
because i whant to see that when the query open. Can i have a nother way ? so it dont look like a notice but like the personne speaking to me ?
Also i whant to add something that i can activate, unactivate the script
For now i got a cheap :
Anti-PV
.Activé:/load -rs armymenscript/army4/army4.army
.DesActivé:/unload -rs armymenscript/army4/army4.army
but i dont whant to see :
* Unloaded script 'C:\Documents and Settings\Patrick Thériault\Bureau\test\armymenscript\army4\army4.army'
* Loaded script 'C:\Documents and Settings\Patrick Thériault\Bureau\test\armymenscript\army4\army4.army'
so another possibility ?
tanks grin

Re: Activate , unactivate a script #151900 23/06/06 01:51 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Change
Code:
 Anti-PV
.Activé:/load -rs armymenscript/army4/army4.army
.DesActivé:/unload -rs armymenscript/army4/army4.army
 
to
Code:
 Anti-PV
.Activé:.load -rs armymenscript/army4/army4.army
.DesActivé:.unload -rs armymenscript/army4/army4.army
 

Re: Activate , unactivate a script #151901 23/06/06 02:15 AM
Joined: Jun 2005
Posts: 37
A
Armymen Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Jun 2005
Posts: 37
\o/
it is possible too add to like on the one activate something like a ( i dont know in english ):
/
\/
or a X ou juste a dot, a - ?
confused

Re: Activate , unactivate a script #151902 23/06/06 02:27 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Do you mean something to indicate if it is active or not? If this is what you mean, then I think something could be done, but I'd need to do some checking and I don't think it would be easy.
While the preferred language on the board is English, if you don't know how to express something in English but do know how to put it in French (which, I think, would be your base language), I don't think anyone would complain with the occasional french reference.

Re: Activate , unactivate a script #151903 23/06/06 02:54 AM
Joined: Jun 2005
Posts: 37
A
Armymen Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Jun 2005
Posts: 37
Quote:
Do you mean something to indicate if it is active or not? If this is what you mean, then I think something could be done, but I'd need to do some checking and I don't think it would be easy.
While the preferred language on the board is English, if you don't know how to express something in English but do know how to put it in French (which, I think, would be your base language), I don't think anyone would complain with the occasional french reference.

yes it exacly what i want wink ( sry for my poor englis :S )

Re: Activate , unactivate a script #151904 23/06/06 05:41 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
;;;;;;;;;;;
; Anti-PV ;
;;;;;;;;;;;
;
#anti-pv ON
;
on ^*:OPEN:?:{ 
  haltdef 
  .msg $nick [Auto Msg] 12!8*12!0!!4!! 9Bonjours, j'utilise un anti-Pv, si j'ai le temps, Je vais vous répondre sous peu 4:11-4)
  .ignore -pu $nick 300 
  .timer 1 0 anti-pv $nick $1- 
} 
alias anti-pv { 
  var %anti-pv.nick = $1 
  var %anti-pv.msg = $2- 
  if ($?!="Privé de %anti-pv.nick $+ , accepter ? $crlf $+ Message: %anti-pv.msg ") { 
    .msg %anti-pv.nick [Auto Msg] Demande de privé accepté \o/ Bonjours sa va ?
    .ignore -r $nick 
    .query %anti-pv.nick 
    echo -itlbfrc normal < $+ %anti-pv.nick $+ > %anti-pv.msg
    ; ^ adds there text to the query
    ;
    var %i = 1 | while ($chan(%i)) { echo -itlbfrc notice - $+ %anti-pv.nick $+ - %anti-pv.msg | inc %i }
    ; ^ fakes a notice from the user of theer text
    ;
  } 
  else { 
    .msg %anti-pv.nick [Auto Msg] Demande de privé refusé dsl :( ! 
  } 
}
;
#anti-pv END
;
menu channel {
.Activé: { .enable #anti-pv }
.DesActivé:{ .disable #anti-pv }
}



I dont understand whats ment to happen here tho, since that stuff only happens after the $?!= is answered so u must know about it by then?!?!?!?!

Re: Activate , unactivate a script #151905 23/06/06 05:45 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This is the closest that I was able to come up with.
Code:
  Anti-PV
  .$iif($script(armymenscript/army4/army4.army),$style(2)) .Activé : load -rs armymenscript/army4/army4.army
  .$iif(!$script(armymenscript/army4/army4.army),$style(2)) .DesActivé: unload -rs armymenscript/army4/army4.army
  

Re: Activate , unactivate a script #151906 23/06/06 08:28 PM
Joined: Jun 2005
Posts: 37
A
Armymen Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Jun 2005
Posts: 37
Quote:
This is the closest that I was able to come up with.
Code:
  Anti-PV
  .$iif($script(armymenscript/army4/army4.army),$style(2)) .Activé : load -rs armymenscript/army4/army4.army
  .$iif(!$script(armymenscript/army4/army4.army),$style(2)) .DesActivé: unload -rs armymenscript/army4/army4.army
  

huuu i dont work, well i dont see nothing on my menu blush

Re: Activate , unactivate a script #151907 23/06/06 08:40 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
LOL stop telling him to use load and unload, im suprised really dude!

You know way better than that, I have seen your code and you have used #groups perfectly before, why you letting him flounder in the dark!

/me looks at RusselB in a new light, are those devil horns appearing out of his head! eeeeek!

Re: Activate , unactivate a script #151908 23/06/06 11:58 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here's a re-write of the code so that it uses groups rather than load/unload (which I had been maintaining simply since that's how the original poster had it). The menu system included in the code has been tested and does work as it is supposed to. Personally I would've preferred some other options, but they don't seem to be available unless they're in a 3rd party dll (which I don't have)
Code:
 ;;;;;;;;;;;
; Anti-PV ;
;;;;;;;;;;;;
#anti-pv off
;
on ^*:OPEN:?:{
  haltdef
  .msg $nick [Auto Msg] 12!8*12!0!!4!! 9Bonjours, j'utilise un anti-Pv, si j'ai le temps, Je vais vous répondre sous peu 4:11-4)
  .ignore -pu $nick 300
  .timer 1 0 anti-pv $nick $1-
}
alias anti-pv {
  var %anti-pv.nick = $1, %anti-pv.msg = $2-
  if ($?!="Privé de %anti-pv.nick $+ , accepter ? $crlf $+ Message: %anti-pv.msg ") {
    .msg %anti-pv.nick [Auto Msg] Demande de privé accepté \o/ Bonjours sa va ?
    .ignore -r $nick
    .query %anti-pv.nick
    echo -itlbfrc normal < $+ %anti-pv.nick $+ > %anti-pv.msg
    ; ^ adds their text to the query
    ;
    var %i = 1
    while ($chan(%i)) {
      echo -itlbfrc notice - $+ %anti-pv.nick $+ - %anti-pv.msg
      inc %i
    }
    ; ^ fakes a notice from the user of their text
    ;
  }
  else {
    .msg %anti-pv.nick [Auto Msg] Demande de privé refusé dsl :( !
  }
}
;
#anti-pv END
;
menu * {
  Anti-PV
  .$iif($group(#anti-pv).status == on,$style(2)) .Activé : .enable #anti-pv
  .$iif($group(#anti-pv).status == off,$style(2)) .DesActivé : .disable #anti-pv
}
 

Re: Activate , unactivate a script #151909 25/06/06 08:30 PM
Joined: Jun 2005
Posts: 37
A
Armymen Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Jun 2005
Posts: 37
Quote:
Here's a re-write of the code so that it uses groups rather than load/unload (which I had been maintaining simply since that's how the original poster had it). The menu system included in the code has been tested and does work as it is supposed to. Personally I would've preferred some other options, but they don't seem to be available unless they're in a 3rd party dll (which I don't have)
Code:
 ;;;;;;;;;;;
; Anti-PV ;
;;;;;;;;;;;;
#anti-pv off
;
on ^*:OPEN:?:{
  haltdef
  .msg $nick [Auto Msg] 12!8*12!0!!4!! 9Bonjours, j'utilise un anti-Pv, si j'ai le temps, Je vais vous répondre sous peu 4:11-4)
  .ignore -pu $nick 300
  .timer 1 0 anti-pv $nick $1-
}
alias anti-pv {
  var %anti-pv.nick = $1, %anti-pv.msg = $2-
  if ($?!="Privé de %anti-pv.nick $+ , accepter ? $crlf $+ Message: %anti-pv.msg ") {
    .msg %anti-pv.nick [Auto Msg] Demande de privé accepté \o/ Bonjours sa va ?
    .ignore -r $nick
    .query %anti-pv.nick
    echo -itlbfrc normal < $+ %anti-pv.nick $+ > %anti-pv.msg
    ; ^ adds their text to the query
    ;
    var %i = 1
    while ($chan(%i)) {
      echo -itlbfrc notice - $+ %anti-pv.nick $+ - %anti-pv.msg
      inc %i
    }
    ; ^ fakes a notice from the user of their text
    ;
  }
  else {
    .msg %anti-pv.nick [Auto Msg] Demande de privé refusé dsl :( !
  }
}
;
#anti-pv END
;
menu * {
  Anti-PV
  .$iif($group(#anti-pv).status == on,$style(2)) .Activé : .enable #anti-pv
  .$iif($group(#anti-pv).status == off,$style(2)) .DesActivé : .disable #anti-pv
}
 

tanks for that one work #1 grin