mIRC Homepage
Posted By: Armymen Activate , unactivate a script - 23/06/06 01:28 AM
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
Posted By: RusselB Re: Activate , unactivate a script - 23/06/06 01:51 AM
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
 
Posted By: Armymen Re: Activate , unactivate a script - 23/06/06 02:15 AM
\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
Posted By: RusselB Re: Activate , unactivate a script - 23/06/06 02:27 AM
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.
Posted By: Armymen Re: Activate , unactivate a script - 23/06/06 02:54 AM
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 )
Posted By: DaveC Re: Activate , unactivate a script - 23/06/06 05:41 AM
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?!?!?!?!
Posted By: RusselB Re: Activate , unactivate a script - 23/06/06 05:45 AM
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
  
Posted By: Armymen Re: Activate , unactivate a script - 23/06/06 08:28 PM
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
Posted By: DaveC Re: Activate , unactivate a script - 23/06/06 08:40 PM
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!
Posted By: RusselB Re: Activate , unactivate a script - 23/06/06 11:58 PM
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
}
 
Posted By: Armymen Re: Activate , unactivate a script - 25/06/06 08:30 PM
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
© mIRC Discussion Forums