J youse this code for my chatterbot.
On *:load: {
/echo 5 -ag Loaded chatterbot script $+(v,1.0) $+ ! By Baloe12nl.
if ( !$readini( scripts/kletsen.ini, Hallo, antw1 ) ) {
/writeini scripts/kletsen.ini Hallo antw1 Hai to you to
}
if ( %timerkls == $null ) { /set %timerkls 0 | /echo 5 -ag timerkls is loaded and set to 0. }
if ( %antkls == $null ) { /set %antkls 1 | /echo 5 -ag antls is loaded and set to 1. }
if ( %antkls.rand == $null ) { /set %antkls.rand 1 | /echo 5 -ag antkls.rand is loaded and set to 1. }
/echo 5 -ag to use, type: !talk < on / off / disable >
}
on *:TEXT:*talk*:*: {
if ($1 == !talk) {
if ($2 == on) { /enable #talks | /disable #Ctalks | /msg $chan 5De Talk Mode Is on, | set %st.talks on | set %last.used.command talks on | set %last.persons1 $nick | halt }
if ($2 == off) { /disable #talks | /enable #Ctalks | /msg $chan 5De Talk Mode Is off. | unset %st.talks | set %last.used.command talks off | set %last.persons1 $nick | halt }
if ($2 == disable) { /disable #talks | /disable #Ctalks | /msg $chan 5De Talk Mode Is off. | /msg $chan 5De teatch Mode Is off. | unset %st.talks | set %last.used.command talks off | set %last.persons1 $nick | halt }
if ($2 == help) { /notice $nick 5< 10!talk on 5> zet de chatterbot op speake mode | /notice $nick 5< 10!talk off 5> Zet de speake mode of en de learn mode aan. | /notice $nick 5< 10!talk disable 5> Zet de learn en speake mode beide off. | /notice $nick 5< 10!talk help 5> Geeft hulp bij de chatterbot comando's. }
else { /notice $nick 5Incorrect command usage: !talk <on/off/disable/help> | halt }
}
else { /halt }
}
; Here the read part and awnser on the chat
; Hier het gedeelte dat leest en antwoord op de chat
#talks off
on *:text:*:#: {
/set %antkls.rand $rand(1, [ %nr ] )
if ( $readini(scripts/kletsen.ini, $1 $+ $2 $+ $3 $+ $4, antw $+ 1 ) == $null ) { /halt }
:1
if ( $readini(scripts/kletsen.ini, $1 $+ $2 $+ $3 $+ $4, antw $+ %antkls.rand ) == $null ) { /dec %antkls.rand 1 | goto 1 }
else { /msg # $readini(scripts/kletsen.ini, $1 $+ $2 $+ $3 $+ $4, antw $+ %antkls.rand ) }
}
#talks end
; Here the write part to ini
; hier gedeelte dat het moet schrijven naar ini
#Ctalks on
on *:text:*:#: {
if ( %timerkls <= 0) { /set %nick $nick | /set %nick1 $1 $+ $2 $+ $3 $+ $4 | /set %timerkls 360 | /dec -c %timerkls 1 | /halt }
if ( %timerkls >= 1 ) {
if ( $nick == %nick ) /halt
if ( $nick == chatbot ) /halt ;Hier de naam van je chatbot op <chatbot> ; Here the name of your Bot on < chatbot >
else {
/set %antkls 1
/set %timerkls 0
if ( $readini( scripts/kletsen.ini, %nick1 $+ , antw $+ %antkls ) != $null ) {
:2
if ( $1- isin $readini( scripts/kletsen.ini, %nick1 $+ , antw $+ %antkls ) ) {
/set %timerkls 0
/unset %nick
/halt
}
if ( %antkls > %nr ) /set %nr %antkls
if ( $readini( scripts/kletsen.ini, %nick1 $+ , antw $+ %antkls ) != $null ) {
/inc %antkls 1
goto 2
}
else {
/writeini -n scripts/kletsen.ini %nick1 antw $+ %antkls $1-
/set %timerkls 0
/unset %nick
; /save scripts/kletsen.ini
/load -rs scripts/kletsen.ini
/halt
}
}
else {
/writeini -n scripts/kletsen.ini %nick1 antw $+ %antkls $1-
/set %timerkls 0
/unset %nick
; /save scripts/kletsen.ini
/load -rs scripts/kletsen.ini
/halt
}
}
}
}
#Ctalks end
In the platform game which I play ( torpia) there are sometimes people who has questions concerning the game to help them I'f made the FAQ snippet. I did not finde 1 i like You can use a ON:TEXT: 1, but the question need to by exact. Now it don't. He now checked simply the words of the question and catch the question from text file with the moste words. He can be off some times, but get it for moste..
thx all for the sugestions.
I was thinking of a text file, but it was more work fore me to make 1 then to do it this way.
@Sorasyn : I've tested it and debugd it. It works. and no bracket appears to be random. I even checked the code after posting it on Hawkee.
I have a sugestion:
add this to the code
;------------->> Variable Version
on *:join:#: {
if ( $nick == %WarnLevel. [ $+ [ $nick ] ] ) {
if ( %WarnLevel. [ $+ [ $nick ] ] >= 5 ) .notice $nick $nick you have %WarnLevel. [ $+ [ $nick ] ] warns now | .notice $nick your warn level must be less than 10.
else .notice $nick $nick you have %WarnLevel. [ $+ [ $nick ] ] Warn(s).
}
else (%WarnLevel. [ $+ [ $nick ] ] == $null) .notice $nick you have 0 Warn(s).
}
;------------->> INI File Version
on *:join:#: {
if ( $nick == $readini(Warns.ini,n,Warns,$nick) ) {
if ( $readini(Warns.ini,n,Warns,$nick) >= 5 ) .notice $nick $nick you have $readini(Warns.ini,n,Warns,$nick) warns now | .notice $nick your warn level must be less than 10.
else .notice $nick $nick you have $readini(Warns.ini,n,Warns,$nick) Warn(s).
}
else ( $readini(Warns.ini,n,Warns,$nick) == $null) .notice $nick you have 0 Warn(s).
}
THis way the people know hawe many warning points they have, ore not.
@Technical_13
I have no Idea how that's done. I'm new her and i'm stil learning about mIRC code scripting.
Ask him?
you have a small problem with your script. elseif ($strip($2) == LOVE) { inc %winc | LoveWale # } It's the same as the WIN.
elseif ($strip($2) == HEART) { inc %heartc | HeartWale # }
elseif ($strip($2) == LOVE) { inc %winc | LoveWale # }
elseif ($strip($2) == WiN) { inc %winc | WinWale # }
elseif ($strip($2) == FAiL) { inc %failc | FailWale # }
I'f change it to elseif ($strip($2) == LOVE) { inc %lovec | LoveWale # }
elseif ($strip($2) == HEART) { inc %heartc | HeartWale # }
elseif ($strip($2) == LOVE) { inc %lovec | LoveWale # }
elseif ($strip($2) == WiN) { inc %winc | WinWale # }
elseif ($strip($2) == FAiL) { inc %failc | FailWale # }
change: notice $nick all together = $iif(%allcc,$v1,0) time(s) to notice $nick all together = $iif(%allc,$v1,0) time(s) else it wil not count the "all"
For the rest THX, after translation to duch I had fune white it. Now some color.....;)
on *:TEXT:!afk*:#: {
if ( $nick isin %qq. [ $+ [ $nick ] ] ) {
/notice $nick $nick $+ ? Je staat al afgemeld. reden: 4 $+ %reason. [ $+ [ $nick ] ] $+
/notice $nick Voor een tijd van: 4 $duration($calc($ctime - %away.time. [ $+ [ $nick ] ] ) ) $+
/notice $nick Als je weer terug bent $nick $+ , Meld je dan weer aan met: 4 !back
}
else ( $nick ) {
/set %reason. [ $+ [ $nick ] ] $2- | /amsg 4 $nick is FF weg
/amsg reden: 4 $+ %reason. [ $+ [ $nick ] ] $+ 9,0 | set %away.time. [ $+ [ $nick ] ] $ctime | enable #away | set %away. [ $+ [ $nick ] ] on | set %qq. [ $+ [ $nick ] ] $nick
}
}
on *:TEXT:!back*:#: {
if ($nick isin %qq. [ $+ [ $nick ] ] ) {
/amsg $nick Is terug van, Reden: 4 $+ %reason. [ $+ [ $nick ] ] $+
/amsg Hij was weg voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $nick ] ] ) ) $+ 6. | unset %reason. [ $+ [ $nick ] ] | disable #away | unset %away.time. [ $+ [ $nick ] ] | unset %away. [ $+ [ $nick ] ] | unset %qq. [ $+ [ $nick ] ] $nick
}
}
On *:TEXT:*:#: {
if ( $1 isin %qq. [ $+ [ $1 ] ] ) {
/msg # $1 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $1 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $1 ] ] $+
}
if ( $2 isin %qq. [ $+ [ $2 ] ] ) {
/msg # $2 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $2 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $2 ] ] $+
}
if ( $3 isin %qq. [ $+ [ $3 ] ] ) {
/msg # $3 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $3 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $3 ] ] $+
}
if ( $4 isin %qq. [ $+ [ $4 ] ] ) {
/msg # $4 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $4 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $4 ] ] $+
}
if ( $5 isin %qq. [ $+ [ $5 ] ] ) {
/msg # $5 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $5 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $5 ] ] $+
}
if ( $6 isin %qq. [ $+ [ $6 ] ] ) {
/msg # $6 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $6 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $6 ] ] $+
}
if ( $7 isin %qq. [ $+ [ $7 ] ] ) {
/msg # $7 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $7 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $7 ] ] $+
}
if ( $8 isin %qq. [ $+ [ $8 ] ] ) {
/msg # $8 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $8 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $8 ] ] $+
}
if ( $9 isin %qq. [ $+ [ $9 ] ] ) {
/msg # $9 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $9 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $9 ] ] $+
}
if ( $10 isin %qq. [ $+ [ $10 ] ] ) {
/msg # $10 is afwezig voor een tijd van:4 $duration($calc($ctime - %away.time. [ $+ [ $10 ] ] ) ) $+
/msg # Reden: 4 $+ %reason. [ $+ [ $10 ] ] $+
}
else goto ww
:ww
}
A adation to the code. This is my first try to adet a code. credit to the origenal code maker