This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

addme by Ozh

Support & discussion of released scripts, and announcements of new releases.
l
lostmyaim
Voice
Posts: 8
Joined: Wed Jul 11, 2007 7:02 pm

addme by Ozh

Post by lostmyaim »

Hi guys,

First of all I would like to thank Ozh for his script and I really appreciate it.

However I get an error while I load my conf file from my eggdrop, This might be discussed many times before but I couldn't find a solution to it.

the error says:

Code: Select all

illegal channel: #gogamers
    while executing
"isop $nick $chan"
    (procedure "addme_maplist_read" line 13)
    invoked from within
"addme_maplist_read $botnick bleh bleh $i"
    ("foreach" body line 24)
    invoked from within
"foreach i [split $addme_channels " "] {
        set addme_randommaps($i) ""
        set addme_current($i) 0
        set addme_list($i) ""
        set addme_begin($i) 0
        set addme..."
    (file "scripts/addme.tcl" line 1588)
    invoked from within
"source scripts/addme.tcl"
    (file "ssbot.conf" line 679)
[18:18] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
I read his Readme.txt several times and followed his instructions but It seems that im missing something that I can't really figure.

I'm new to this TCL community so accept my apologies, I just needed it to organise my games through IRC.

Any input/help would be really appreciated.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Might be as simple as... since you've given so little context to your problem other than a .set errorInfo...

Your bot isn't in #gogamers yet, meaning you haven't even defined that channel. So before you add this script to your eggdrop.conf (or ssbot.conf in your case), start bot without it and get it on irc, dcc chat it up and .+chan #gogamers on your bots partyline, kill bot (.die), add script to eggdrop.conf, manually restart your bot..

This is why it's better when those coding choose to use .chanset to activate their script per channel (chanset has built-in capability to prevent this situation). The coder who wrote this doesn't even check if bot is in the channel before having it check if it's opped, effectively making it hard to use the script if its placed on a brand new fresh bot, because you can't even get the bot started.. heh

I'm also assuming you followed the readme, and did the config correctly, changing all those #pickup1 #pickup2 var sections to your given channel names.

Also, don't listen at ALL to this advice in the readme: Edit the script with a raw text editor, on Windows your Notepad will do fine. DONT USE WORDPAD OR WORD.

As quite the contrary, NEVER use notepad to edit tcl scripts ever, ever, ever never. Always use wordpad and always choose to save as .txt document. Just word of advice. Post back your config section if this doesn't help you get it working so we have more context to your problem.
l
lostmyaim
Voice
Posts: 8
Joined: Wed Jul 11, 2007 7:02 pm

Post by lostmyaim »

Hi Speechless, thanks alot for your instant help man :)

I launched my bot smoothly by commenting out the script, and made it join #gogamers and set everything and then I .die it.

I have edited the tcl script by Worpad just like you said and saved it as .txt and replaced it with the other one then. I launched my bot and it gave me the same error message, I'm sorry that I don't know how get any more info on the error. I followed the instruction on http://forum.egghelp.org/viewtopic.php?t=10215 how to .set errorInfo but I still get "`What? You need .help'" so there should be something wrong with the conf.

The tcl script is too large to be pasted in here so I had to host it along with my conf file.

http://www.gigasize.com/get.php/-1099918952/ssbot.conf
http://www.gigasize.com/get.php/-1099918953/addme.tcl

Looking forward to your reply, Thanks again.
Last edited by lostmyaim on Thu Jul 12, 2007 12:30 am, edited 1 time in total.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Are you sure you've .+chan'd the bot to actually reside/stay/idle in the chan and create channel records? If it's saying invalid channel you need to create a valid channel entry.

the problem is this evaluation:
if {![isop $nick $chan] && $nick != $botnick} {

Now the problem isn't entirely this evaluations fault. The problem is that this evaluation cannot be expressed for an invalid channel. A [validchan $chan] check must be performed before any isop's tests. What you can do to fix it is put this check before any of these tests.
The quick fix goes like this:
step 1) Open the script in wordpad, and go to the EDIT -> Replace... in the menu bar
step 2) For 'find what' use this:

Code: Select all

if {$chan == "" || $chan == "{}" || ![info exists chan] || ![regexp $chan $addme_channels]} {
step 3) For 'replace with' use this:

Code: Select all

if {![validchan $chan] || ![info exists chan] || ![regexp $chan $addme_channels]} {
step 4) Now click the replace all button.

This should stop the problem, but all would be solved too if you .+chan #gogamers on your partyline before installing this script...

Also, to get .set errorInfo working just find this section in your eggdrop.conf

Code: Select all

# Comment these two lines if you wish to enable the .tcl and .set commands.
# If you select your owners wisely, you should be okay enabling these.
to enable .set and .tcl commands in partyline comment out the two unbinds like it says to.. heh

Code: Select all

#unbind dcc n tcl *dcc:tcl
#unbind dcc n set *dcc:set
l
lostmyaim
Voice
Posts: 8
Joined: Wed Jul 11, 2007 7:02 pm

Post by lostmyaim »

Thanks again :)

I did .+chan in the partyline and gave it op.

Switched all the lines just like how you said.

The bot started with no errors, that was perfect :)

The owner of the script says after editing the script, and when it joins the channel I must type !removeall to clear topics to start with a valid one. so I did but it didn't respond to that or any other !command, any clues?

thats what I got "[01:17] Tcl error [addme_removeall]: can't read "addme_removeallop()": no such element in array"

.set errorInfo


Currently: can't read "addme_removeallop()": no such element in array
Currently: while executing
Currently: "if {$addme_removeallop($chan)} {
Currently: if {![isop $nick $chan] && $nick != $botnick} {
Currently: putnick $nick "Sorry \002$nick\002, admin command : you need to ..."
Currently: (procedure "addme_removeall" line 27)
Currently: invoked from within
Currently: "addme_removeall $_msg1 $_msg2 $_msg3 $_msg4"
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

this script is pretty buggy, and mostly because it lacks sanity checks.

step 1) load up wordpad with the script and find this line below, change the $text to $chan

Code: Select all

if {![regexp $text $addme_channels]} {
step 2) now the menubar again with EDIT -> replace...
step 3) For 'find what' use this:

Code: Select all

if {![regexp $chan $addme_channels]} {
step 4) For 'replace with' use this:

Code: Select all

if {![validchan $chan] || ![info exists chan] || ![regexp $chan $addme_channels]} {
step 5) Now click the replace all button.

If this doesn't solve all the issues, I suggest some other more talented scripter attempt to resolve this issue as I am now fresh out of ideas.. hehe
8)
l
lostmyaim
Voice
Posts: 8
Joined: Wed Jul 11, 2007 7:02 pm

Post by lostmyaim »

Hey speechless, this is getting fun and educative :)

Those corrections worked just fine.

Thanks for the help :)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

	set tt [topic $chan]
	regsub -all "\[ ]{1,}" $tt " " tt

	if {$tt == ""} {
		set tt "Next : [addme_buildlist $addme_number($chan)] | Server : 127.0.0.1 pass toto | HF & CVC"
	}
Here is the part which can reset your topic. All here looks fine to me. This should work.

Have you unset the topic? When you type .topic #gogamers your Bot needs to tell you this: <YourBot> No topic is set for #gogamers. To do this just use your irc client and blank the topic. Erase all there, hit okay. I'm not 100% sure how to make the bot kill a channel topic.. But I am aware how to make an irc client do it.

also.. This code here is easily broken:

Code: Select all

![regexp $chan $addme_channels]
this may cause you problems if any channels are a mix of upper/lower case. So instead change that to this:

Code: Select all

![regexp -nocase $chan $addme_channels]
so just use the same method, replace all these occurences with wordpad like I had you do before. Lemme know if this works. The script is really buggy and the comment section was made to have users work around these bugs, foolish. Whoever coded this even makes fun of the people using it in the comments section if they don't work around these obvious bugs, even foolishier (is that even a word, it needs to be.. hehe). Is why it's painful looking at the needless procs (the foolishness) in this script that mimic built-in tcl commands. Anyways, lemme know if any of this helps.
l
lostmyaim
Voice
Posts: 8
Joined: Wed Jul 11, 2007 7:02 pm

Post by lostmyaim »

Hey speechless dude I thought you gave up on me :) but thanks for the come back!

Well I cleared the topic and I /msg bot !removeall #gogamers

and it set the channel topic to "Next : ./././././././././. | Server : 127.0.0.1 pass toto | HF & CVC" what it supposed to do.

Its progressing, I have added servers list and maps list but whenever I type a !command in the channel it says

[16:53] Tcl error [addme_addname]: can't read "addme_addop(#Gogamers)": no such element in array
[16:53] Tcl error [addme_removeall_pub]: can't read "addme_removeallop(#Gogamers)": no such element in array


Code: Select all

.set errorInfo

Currently: can't read "addme_removeallop(#Gogamers)": no such element in array
Currently: while executing
Currently: "if {$addme_removeallop($chan)} {
Currently:   if {![isop $nick $chan] && $nick != $botnick} {
Currently:    putnick $nick "Sorry \002$nick\002, admin command : you need to ..."
Currently:     (procedure "addme_removeall" line 27)
Currently:     invoked from within
Currently: "addme_removeall $nick $mask $hand $chan"
Currently:     (procedure "addme_removeall_pub" line 10)
Currently:     invoked from within
Currently: "addme_removeall_pub $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
So its a matter of lower/upper letters? interseting the channel already created and there are users in it, should I kick them all and /join #gogamers or try to change the channel name in the tcl ?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

nah, this is just bad coding on the part of whoever wrote this. I can easily fix the problem. Instead just try these fixes below: :)
find all:

Code: Select all

set chan [lindex $arglist 0]
replace all with:

Code: Select all

set chan [string tolower [lindex $arglist 0]]
and one other spot where this guy is inconsistant
find once:

Code: Select all

set chan $text
replace once with:

Code: Select all

set chan [string tolower $text]
This should solve all the sanity problems of this script. It should've been written this way to begin with, using full sanity checks.. but meh, some coders are inherintly lazy... Hopefully you've got a nice pickup-game bot now and it's working as intended. :lol:

Also, make sure you've added the -nocase switch to the regexp's like I explained in my post above, this is required.

To others browsing this thread, for future reference:
These fixes eliminate the need to add channels to your eggdrop.conf like was originally intended by the author, now you may add channels via .+chan on your bot's partyline and it will recognize them without crashing. These fixes also eliminate the need to keep your channel names entirely lowercase, you can freely create entirely #UPPERCASE channels or a #MiXnMaTcH and use this script as well, just remember to keep the channel name references in the tcl config completely lowercase. :wink:
l
lostmyaim
Voice
Posts: 8
Joined: Wed Jul 11, 2007 7:02 pm

Post by lostmyaim »

I have done all of those corrections one by one again from the first post to the last reply just to make sure.

And then I get

[18:05] Tcl error [addme_addname]: can't read "addme_addop(#Gogamers)": no such element in array

[18:05] Tcl error [addme_removename]: can't read "addme_removeop(#Gogamers)": no such element in array

[18:06] Tcl error [addme_recall]: can't read "addme_autoremoveall(#Gogamers)": no such element in array

Code: Select all

set errorInfo
Currently: can't read "addme_autoremoveall(#Gogamers)": no such element in array
Currently:     while executing
Currently: "if {$addme_autoremoveall($chan)} {
Currently:   putnick $nick "Command not available in channel\002 $chan"
Currently:   return recall:not_available
Currently:  }"
Currently:     (procedure "addme_recall" line 18)
Currently:     invoked from within
Currently: "addme_recall $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
Hmm , any thoughts?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

AHAHAHA.. I knew it wasn't over :lol:

it's so fun going through someone else's spaghetti soup, this script is so inconsistent in it's structures. Also, keep in mind that I have not run this script at all. I'm going off what you tell me your errors are, and logically trying to solve them as you pop them up. So we might be playing ping-pong for a bit longer. It's okay. It may help others too...

So to start off, this may be harder than the last fixes, but it will solve the inconsistencies in this code quickly. You need to search for proc addme_ (there will be many of these found btw, you need to fix them all) and check for the list of global variables that starts off that section. At the end of these declarations (the global list) you just need to add:

Code: Select all

set chan [string tolower $chan]
As an example, here is what it would then look like for the first section, proc addme_tellmaps:

Code: Select all

	global addme_channels
	global addme_maps
	global addme_randommaps
	global addme_pickNmaps
	global addme_announcemaps
	global addme_begin
	global botnick
	set chan [string tolower $chan]
Repeat the same for every single occurence of proc addme_ that you find adding the set chan [string tolower $chan] to the end of the global section. Once finished, you should have a sanitized and bug proof bot..*crosses fingers*.. This is what the original coders intentions should have been when writing this script, it would have made it popular and the comment section berating users unneccessary.

im ready for your return volley, hopefully saying it's now a behaved bot. 8)
l
lostmyaim
Voice
Posts: 8
Joined: Wed Jul 11, 2007 7:02 pm

Post by lostmyaim »

Done that in every proc_addme under globals added set chan [string tolower $chan] just like the example.

Now the bot doesn't react at all. No errors nothing. Before that it used to change the topic when I /msg bot !removeall #gogamers now nothing.

Ping Pong :P

#edit

My bad I edited by Notpad, corrected with Wordpad, now working smoothly I just need to try all the commands.


Now !removeall !add !recall !remove they work great
just !addserver and !addmap still bugging

.set errorInfo

Currently: can't read "chan": no such variable
Currently: while executing
Currently: "string tolower $chan"
Currently: (procedure "addme_serverlist_add" line 9)
Currently: invoked from within
Currently: "addme_serverlist_add $_msg1 $_msg2 $_msg3 $_msg4"

[19:59] Tcl error [addme_serverlist_add]: can't read "chan": no such variable

[19:58] Tcl error [addme_maplist_add]: can't read "chan": no such variable

I think we almost there :)
Last edited by lostmyaim on Fri Jul 13, 2007 8:05 pm, edited 1 time in total.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Alrighty, it's become a bigger problem than can be expressed with snippets of code, so I've compiled all the fixes into a complete script. Based off the original this includes all the fixes in this thread + some found as i tried to follow the flow of logic through the script. So give This a try and let me know if it still causes problems. :P

Edit: just saw the above edit that my fixes worked, so now for others wanting the script for their channels, use (http://ereader.kiczek.com/Addme+Fixes.tcl) this instead of the copy currently on egghelp tcl archive. It addresses the issues of channel restriction, allowing you to be in #THIS or #ThAt, instead of forcing #lowercase channel names. Also eliminates the need to embed channels into eggdrop.conf, you can simply .+chan them now.

Edit2: Did you try the copy I'm hosting? Curious if this solves it all.

Code: Select all

Currently: can't read "chan": no such variable
Currently: while executing
Currently: "string tolower $chan"
Currently: (procedure "addme_serverlist_add" line 9)
Currently: invoked from within
Currently: "addme_serverlist_add $_msg1 $_msg2 $_msg3 $_msg4" 
This error is caused by my fixes. This procedure doesn't require a channel. In the hosted version in this post, these have been eliminated.
l
lostmyaim
Voice
Posts: 8
Joined: Wed Jul 11, 2007 7:02 pm

Post by lostmyaim »

Now its official, Addme+Fixes.tcl by Speechless is operational and ready for those who want to organize games through IRC.

Thanks to Speechless for his patience. He did a really great job on this.

Thanks again :)
Post Reply