| View previous topic :: View next topic |
| Author |
Message |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Fri Jul 22, 2005 5:11 pm Post subject: |
|
|
Well.
| Code: | proc clone:scan {host chan} {
set fp [open "clonescan.$chan" a]
foreach host {[chanlist $chan]} {
set host *!*@[lindex [split $host "@"] 1]
puts $fp $host
}
close $fp
clone:check $host $chan
}
proc clone:check {host chan} {
set fp [open "clonescan.$chan" r]
set data [read -nonewline $fp]
close $fp
set hosts [split $data "\n"]
foreach host {[chanlist $chan]} {
set host *!*@[lindex [split $host "@"] 1]
if {[string match "$host" $hosts]} {
inc clones($chan) 1
}
}
} |
Thats basic. Just a file and a string match. But hopefully it works. I havn't tested it yet. Oh, and nice script metriod never noticed you made it this morning. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Jul 22, 2005 5:44 pm Post subject: |
|
|
let me enlighten you on a very important subject: if you don't test your code - and I don't think you've ever tested a single line written by yourself - it's basically the same if you believe you can drive since you have seen other people drive, having never driven a car yourself
for starters, [chanlist] doesn't return a host list, it returns a nick list, so your code is absolutely disfunctional
and apparently you haven't bothered to consider what I suggested to you earlier, about file access and maintaining list structures in memory... remember? I even wrote an example of that, especially for you |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Fri Jul 22, 2005 6:19 pm Post subject: |
|
|
that memory stuff is complicated for me. I will loke through a guide to find out more. Then i will correct my script. I need to change:
| Code: | foreach host {[chanlist $chan]} {
set host *!*@[lindex [split $host "@"] 1]
puts $fp $host
}
|
To
| Code: | foreach nick {[chanlist $chan]} {
set host [getchanhost $nick $chan
set host *!*@[lindex [split $host "@"] 1]
puts $fp $host
}
|
Then if you could please help me more of this memory stuff i could ditch that puts fp and the file stuff and just use memory. Im not good with this memory stuff. Then, can i still use string match with this memory stuff to match any hosts. Also, how can i increase a variable by 1. Thanks for your help so far, im willing to learn more about this memory stuff and get this script tested and completed. Also maybe a antipjen-drone script if you could help with that aswell. Trying my best ;p. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Jul 23, 2005 3:11 am Post subject: |
|
|
| precisely which part of this you did not understand? |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sat Jul 23, 2005 11:56 am Post subject: |
|
|
| Code: |
foreach nick {[chanlist $chan]} {
set host [getchanhost $nick $chan]
set host *!*@[lindex [split $host "@"] 1]
}
set clonescan($channel) {}
foreach hosts {[$host]} {
if {[set idx [lsearch $clonescan($chan) $hosts]] != -1} {
lset $clonescan($channel) $idx $hosts
}
}
set clonecheck 1
if {$clonecheck} {
foreach hostcheck {[$hosts]} {
if {[string match "$hostcheck" "$clonescan($channel)"]} {
incr clones($channel)
}
}
}
|
Ok, I read some guides and made this simple script. Hopefully it works. Demond can you check that code is correct as you know alot about data structures in memory. Atleast i tryed . _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Jul 23, 2005 12:15 pm Post subject: |
|
|
| TEST IT YOURSELF AND FIND OUT IF ITS CORRECT. |
|
| Back to top |
|
 |
Dizzle Op
Joined: 28 Apr 2005 Posts: 109
|
Posted: Sat Jul 23, 2005 1:08 pm Post subject: |
|
|
man tosser learn too test ot out yourself dude, 90 % of your post are filled with question "is this code alright, i dont want too test it" _________________ What's this real life ppl keep talking about ??? And where can I download it ??? |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sat Jul 23, 2005 5:37 pm Post subject: |
|
|
Ok. I have tested the script but got some errors which i can fix myself. But, can anyone tell me how i can get a random bot to join the channel. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Sat Jul 23, 2005 8:50 pm Post subject: |
|
|
this should let you pick a random bot
| Code: | | set randombot [lindex [bots] [rand [llength [bots]]]] |
|
|
| Back to top |
|
 |
rt Voice
Joined: 08 Jul 2005 Posts: 25
|
Posted: Sun Jul 24, 2005 6:18 am Post subject: |
|
|
| Tosser^^ wrote: | | Ok. I have tested the script but got some errors which i can fix myself. But, can anyone tell me how i can get a random bot to join the channel. |
i recall you from IRC miethering me like mad to create you a clonescan |
|
| Back to top |
|
 |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Sun Jul 24, 2005 8:19 am Post subject: |
|
|
| rt wrote: | | Tosser^^ wrote: | | Ok. I have tested the script but got some errors which i can fix myself. But, can anyone tell me how i can get a random bot to join the channel. |
i recall you from IRC miethering me like mad to create you a clonescan |
He does that a lot  _________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sun Jul 24, 2005 9:50 am Post subject: |
|
|
oh no. not rt. The one how banned me on all the #antipjen bots because he didnt get his own way. what a loser he is. And now he has got himself banned on 19 bots on 153 channels.
Thanks for that random bot code greenbear. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
rt Voice
Joined: 08 Jul 2005 Posts: 25
|
Posted: Sat Jul 30, 2005 8:58 am Post subject: |
|
|
| Tosser^^ wrote: | oh no. not rt. The one how banned me on all the #antipjen bots because he didnt get his own way. what a loser he is. And now he has got himself banned on 19 bots on 153 channels.
Thanks for that random bot code greenbear. |
please please refrase that.
You mess me around, I ban you.
And I'm banned on 19 bots, like I care? Get out more, please.  |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Jul 30, 2005 11:05 am Post subject: |
|
|
| rt wrote: | | Tosser^^ wrote: | oh no. not rt. The one how banned me on all the #antipjen bots because he didnt get his own way. what a loser he is. And now he has got himself banned on 19 bots on 153 channels.
Thanks for that random bot code greenbear. |
please please refrase that.
You mess me around, I ban you.
And I'm banned on 19 bots, like I care? Get out more, please.  |
in case you haven't noticed, here you are not on your local qnet ban discussion forum, so better stick to the topic(s) |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Jul 30, 2005 11:54 am Post subject: |
|
|
carefull demond, or everyone will ban you on quakenet
 |
|
| Back to top |
|
 |
|