Mise en forme de code: pensez à utiliser les balises [ tcl ] et [ /tcl ] (sans les espaces bien sûr) autour de vos codes tcl afin d'avoir un meilleur rendu et une coloration syntaxique. x


bind pub pour megahal
#1
Bonjour,

J'ai, il y a un moment, fais des raccourcis pour le script MegaHAL_Interface.tcl afin de mieux gérer le robot via le salon.

Je lance ici les raccourcis bind pub que j'ai a la fin de mon fichier MegaHAL_Interface.tcl et pas .cfg, bien lire.

De préférence a vos personnalisations.

Dans ses bind's vous auriez compris que la syntaxe est . et pas ! (comme par défaut au script).

Bien a vous!

------------------------------------------
# Code



tcl
bind pub n .mc pub_maxcontext
proc pub_maxcontext {nick host hand channel text} {
  global botnick
    set file [string map {" " *} $text]
    if {$text == ""} {
    puthelp "PRIVMSG $channel :$megahal_interface::maxcontext"
    return 1
    }
set megahal_interface::maxcontext $text
puthelp "PRIVMSG $channel :$megahal_interface::maxcontext"
  return 0
}
 
bind pub n .so pub_rsof
proc pub_rsof {nick host hand channel text} {
  global botnick
    set file [string map {" " *} $text]
    if {$text == ""} {
    putquick "PRIVMSG $channel :Temps en reponse à ($megahal_interface::reply_speed_offset ) offset"
    return 1
    }
set megahal_interface::reply_speed_offset $text
putquick "PRIVMSG $channel :Vitesse de reponse à ($megahal_interface::reply_speed_offset) offset"
  return 0
}
 
bind pub n .tw pub_triggerwordz
proc pub_triggerwordz {nick host hand chan text} {
  global botnick
    set file [string map {" " *} $text]
    if {$text == ""} {
    putquick "notice $nick :12,1Trigger sur les mots 7(4 $megahal_interface::trigger_words 7)"
# putquick "notice $nick :12,1Ok $nick!"
    return 1
    }
set megahal_interface::trigger_words $text
putquick "notice $nick :12,1Trigger sur les mots 7(4 $megahal_interface::trigger_words 7)"
putnow "PRIVMSG #teststatik :\00304::INFORMATION:: 12,1Trigger \003\00314par\003\00304 $nick \003\00314salon\003\00304 $chan \003\00314sur les mots:"
putnow "privmsg #teststatik :7(4 $megahal_interface::trigger_words 7)"
#timer 45 ::tw_reset
  return 0
}
proc ::tw_reset {} {
set megahal_interface::trigger_words "$::botnick"
}
 
bind pub o|o .taistoi pub_triggerwordz2
proc pub_triggerwordz2 {nick host hand chan text} {
  global botnick
  set megahal_interface::trigger_words $::botnick
  putserv "privmsg $chan :Bien a vous!"
}
 
bind pub n .nsr pub_nsr
proc pub_nsr {nick host hand channel text} {
  global botnick
    set file [string map {" " *} $text]
    if {$text == ""} {
    putquick "PRIVMSG $channel :12,1NickSwitchRate maintenant à 7(4 $megahal_interface::nickswitchrate% 7)"
    return 1
    }
set megahal_interface::nickswitchrate $text
putquick "PRIVMSG $channel :12,1NickSwitchRate maintenant à 7(4 $megahal_interface::nickswitchrate% 7)"
  return 0
}
 
bind pub n .rs pub_rsc
proc pub_rsc {nick host hand channel text} {
  global botnick
    set file [string map {" " *} $text]
    if {$text == ""} {
    putquick "PRIVMSG $channel :$megahal_interface::reply_speed_coeff"
    return 1
    }
set megahal_interface::reply_speed_coeff $text
putquick "PRIVMSG $channel :$megahal_interface::reply_speed_coeff"
  return 0
}
 
bind pub n .nrr pub_neutralreply2
proc pub_neutralreply2 {nick host hand channel text} {
  global botnick
    set file [string map {" " *} $text]
    if {$text == ""} {
    putquick "privmsg $channel :12,1Neutral Reply Rate à 7(4 $megahal_interface::2nd_neutral_reply_rate% 7)"
    return 1
    }
set megahal_interface::2nd_neutral_reply_rate $text
putquick "privmsg $channel :12,1Neutral Reply Rate maintenant à 7(4 $megahal_interface::2nd_neutral_reply_rate% 7)"
  return 0
}

  Reply
#2
Avec une petite doc sur les binds disponibles et ce qu'ils font ?
Je ne connais pas MegaHAL, et encore moins MegaHAL_Interface (bien que je respecte son auteur lorsqu'il ne touche pas à ses truites), par coeur, du coup ça ne me parle vraiment pas du tout.
zeolia: tchat gratuit, sans inscription ni publicité
Merci de ne pas demander d'aide en MP
Away
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)