| View previous topic :: View next topic |
| Author |
Message |
SaW Voice
Joined: 19 Jan 2007 Posts: 8 Location: Turkey
|
Posted: Mon Jan 22, 2007 1:05 am Post subject: Problem with "LIST" then channel remove.. |
|
|
| Code: | set globalkanallar {
"#uluchat"
"#master"
"#help"
"#lobi"
"#sihirli"
}
bind raw - "322" kanal_listele
set listzaman 1
set usersayisi 8
if {![string match "*kanal_listesi*" [timers]]} {
timer $listzaman kanal_listesi
}
proc kanal_listesi {} {
global listzaman
putserv "LIST"
timer $listzaman kanal_listesi
return 1
}
proc kanal_listele {from keyword arg} {
global usersayisi globalkanallar
set listekanaladi [lindex $arg 1]
set guncelsayi [lindex $arg 2]
if {![string match -nocase $listekanaladi [lrange $globalkanallar 0 end]]} {
if {$guncelsayi > $usersayisi} {
channel add $listekanaladi
}
if {$guncelsayi < $usersayisi} {
channel remove $listekanaladi
} else {
return 0
}
}
return 0
} |
i have a problem with channel remove.. i want to bot makes List channels every 1 min then if channel users number much than 8, bot do "channel add" that chans. And if channel users number less than 8, bot do "channel remove" that chans. But i dont want if the channel on my globalkanallar list do anything.. But bot doesnt work that i want.. Bot do "channel remove " the all channels that less than 8 even on my globalkanallar list.
What is my mistake?
Sorry for my english.. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Jan 22, 2007 3:30 am Post subject: |
|
|
Try the following:
| Code: | $guncelsayi >= $usersayisi
$guncelsayi <= $usersayisi |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
SaW Voice
Joined: 19 Jan 2007 Posts: 8 Location: Turkey
|
Posted: Mon Jan 22, 2007 4:06 am Post subject: |
|
|
| Code: | set globalkanallar {
"#uluchat"
"#master"
"#help"
"#lobi"
"#sihirli"
}
bind raw - "322" kanal_listele
set listzaman 1
set usersayisi 8
if {![string match "*kanal_listesi*" [timers]]} {
timer $listzaman kanal_listesi
}
proc kanal_listesi {} {
global listzaman
putserv "LIST"
timer $listzaman kanal_listesi
return 1
}
proc kanal_listele {from keyword arg} {
global usersayisi globalkanallar
set listekanaladi [lindex $arg 1]
set guncelsayi [lindex $arg 2]
if {[lsearch -exact $globalkanallar [string tolower $listekanaladi]] != -1} {return 0}
if {$guncelsayi > $usersayisi} {
channel add $listekanaladi { flood-chan 10:2 }
}
if {$guncelsayi < $usersayisi} {
channel remove $listekanaladi
} else {
return 0
}
}
|
i changed codes to this.
everything is ok. But i have have a new problem :S
[10:05] (ScanX): [03:05] Tcl error [kanal_listele]: no such channel record
[10:05] (ScanX): [03:05] Tcl error [kanal_listele]: no such channel record
[10:05] (ScanX): [03:05] Tcl error [kanal_listele]: no such channel record
[10:05] (ScanX): [03:05] Tcl error [kanal_listele]: no such channel record
[10:05] (ScanX): [03:05] Tcl error [kanal_listele]: no such channel record
[10:05] (ScanX): [03:05] Tcl error [kanal_listele]: no such channel record
[10:05] (ScanX): [03:05] Tcl error [kanal_listele]: no such channel record
any idea? |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Mon Jan 22, 2007 6:46 am Post subject: |
|
|
You should use a check to see if the channel is added.
For channel add:
| Code: | if {![validchan $listekanaladi]} {
channel add $listekanaladi { flood-chan 10:2 }
} |
For channel remove:
| Code: | if {[validchan $listekanaladi]} {
channel remove $listekanaladi
} |
_________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Jan 22, 2007 12:38 pm Post subject: |
|
|
| Code: | set globalkanallar {
"#uluchat"
"#master"
"#help"
"#lobi"
"#sihirli"
}
bind raw - "322" kanal_listele
set listzaman 1
set usersayisi 8
if {![string match "*kanal_listesi*" [timers]]} {
timer $listzaman kanal_listesi
}
proc kanal_listesi {} {
global listzaman
putserv "LIST"
timer $listzaman kanal_listesi
}
proc kanal_listele {from keyword arg} {
global usersayisi globalkanallar
set listekanaladi [lindex $arg 1]
set guncelsayi [lindex $arg 2]
if {[lsearch -exact $globalkanallar [string tolower $listekanaladi]] != -1} {return 0}
if {$guncelsayi >= $usersayisi && ![validchan $listekanaladi]} {
channel add $listekanaladi { flood-chan 10:2 }
}
if {$guncelsayi < $usersayisi && [validchan $listekanaladi]} {
channel remove $listekanaladi
}
return 0
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
SaW Voice
Joined: 19 Jan 2007 Posts: 8 Location: Turkey
|
Posted: Mon Jan 22, 2007 8:14 pm Post subject: |
|
|
| Thanks Sir_Fz it is ok. |
|
| Back to top |
|
 |
|