egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Latest Urban Dictionary tcl
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Wed Oct 09, 2013 9:18 am    Post subject: Reply with quote

I'm still getting a:

Code:
Tcl error [::urbandict::pub]: can't read "define": no such variable

_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
neocharles
Voice


Joined: 23 Apr 2013
Posts: 34

PostPosted: Wed Oct 09, 2013 12:48 pm    Post subject: Reply with quote

Trixar_za wrote:
neocharles: Try my urban.tcl @ http://www.trixarian.net/Projects/


I get the following error when I try to set the mode...
Code:
[12:45pm] <neocharles> .chanset #channame +urban
[12:45pm] <Oracle> Error trying to set +urban for #channame, invalid mode.

It does show that the script was loaded, however.


<EDIT>

I saw you have it as
Code:
setudef flag bcmds
Back to top
View user's profile Send private message
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Wed Oct 09, 2013 2:31 pm    Post subject: Reply with quote

Trixar_za: did you update the script and forgot to update the .zip? I'm still getting that "define" error Confused

also, sputnik's version does work but doesn't show examples.
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Wed Oct 09, 2013 2:42 pm    Post subject: Reply with quote

spithash wrote:
I'm still getting a:
Code:
Tcl error [::urbandict::pub]: can't read "define": no such variable
I restarted the bot after copying the files from the redownloaded zip file and I still couldn't reproduce this bug.

Make sure you're copying the files to the right place and that it has the permission to overwrite them. Sometimes I copy the files into the root eggdrop directory rather than the scripts directory myself.

neocharles: Oops, my bad. The flag is now correctly set to urban now.
EDIT: I updated urban.tcl to make it look a little bit more like this version.
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Wed Oct 09, 2013 3:00 pm    Post subject: Reply with quote

Trixar_za wrote:
spithash wrote:
I'm still getting a:
Code:
Tcl error [::urbandict::pub]: can't read "define": no such variable
I restarted the bot after copying the files from the redownloaded zip file and I still couldn't reproduce this bug.

Make sure you're copying the files to the right place and that it has the permission to overwrite them. Sometimes I copy the files into the root eggdrop directory rather than the scripts directory myself.


Well I tried disabling all my other scripts in both 1.6 and 1.8 bots and still get the same error dude Sad

EDIT: yeah I tried erasing previous files and make a clean load of your zip file/scripts
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Wed Oct 09, 2013 3:04 pm    Post subject: Reply with quote

You can see it running here (as GameBot) so I really don't know what's wrong. I re-uploaded the zip file, so maybe try downloading it again to check.
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Wed Oct 09, 2013 3:41 pm    Post subject: Reply with quote

With spithash's help I identified the bug. My regex was too broad and got caught by some definitions with links in them.

To fix it, just use the following:
Code:
if {[regexp -all -inline {<td class='text' colspan='.' id='.*?'>(.*?)</td} $data] != ""} {
  set matches [regexp -all -inline {<td class='text' colspan='.' id='.*?'>(.*?)</td} $data];
} elseif {[regexp -all -inline {<div class='text' colspan='.' id='entry.*?'>(.*?)<a class} $data] != ""} {
  set matches [regexp -all -inline {<div class='text' colspan='.' id='entry.*?'>(.*?)<a class} $data];
} else {
  set matches "";
}
Also the zip file has been updated @ http://trixarian.net/downloads/urband.zip as per usual

EDIT: Just when I thought I had it fixed, a few bugs came up. It should be fully fixed now... I hope.
_________________
http://www.trixarian.net/Projects


Last edited by Trixar_za on Wed Oct 09, 2013 4:27 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Wed Oct 09, 2013 3:45 pm    Post subject: Reply with quote

hehe I did nothing, it is fully working now, good job! Smile
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Mon Nov 04, 2013 1:46 am    Post subject: Reply with quote

Sneaked in another update:
* Fixed a potential bug with examples. It shouldn't break the script when the site changes the layout again...
* Commented out the messages about exceeding the max lines limit - I mean, does the bot really need to tell us that and use another line in the process?

Update at the usual spot: http://trixarian.net/downloads/urband.zip
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Mon Jan 13, 2014 1:46 pm    Post subject: Reply with quote

Alrighty, it's update time because Urban Dictionary changed their site layout again:
* Added in another two lines so it can match the new layout:
Code:
  } elseif {[regexp -all -inline {<a class=['"]add_to_list['"] data-defid=['"].*?['"] href=['"]#['"]>(.*?)<a class} $data] != ""} {
    set matches [regexp -all -inline {<a class=['"]add_to_list['"] data-defid=['"].*?['"] href=['"]#['"]>(.*?)<a class} $data];

* Made the script match either ' or " when used in a div or a tag using ['"] in the regex. This gives the script more matching flexiablity for future changes.

Grab the latest copy of the script from the usual link:
http://trixarian.net/downloads/urband.zip

Enjoy!
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
tmyoungjr
Voice


Joined: 24 Aug 2007
Posts: 14

PostPosted: Mon Jan 27, 2014 1:57 pm    Post subject: Reply with quote

Just noticed today that the UD script was spitting out n/a for every definition but still spit out appropriate examples.

Looks like they changed formats again (shocking!)

All I did was commented out

Code:
#    regexp -nocase -- {<div class=['"]definition['"]>(.*?)</div>} $match -> definition


and added

Code:

regexp -nocase -- {<div class=['"]meaning['"]>(.*?)</div>} $match -> definition


If there's a cleaner way that's fine. This just made it work for the moment until someone far more versed in this repairs it properly.
Back to top
View user's profile Send private message
spithash
Master


Joined: 12 Jul 2007
Posts: 245
Location: DALnet, EFnet & Freenode

PostPosted: Wed Jan 29, 2014 10:51 am    Post subject: Reply with quote

awesome, thank you! Smile
_________________
DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
doubleu
Voice


Joined: 10 Feb 2008
Posts: 11

PostPosted: Wed Feb 05, 2014 4:26 pm    Post subject: Reply with quote

Things seemed to be working a week or two ago. Is anyone else getting results like this now?

Code:

[14:24] <nick> !ud eggdrop
[14:24] <bot> Definition [1/4]: n/a
[14:24] <bot> Example [1/4]: k3nny on #bucktoof at irc.gamesurge.net is the greatest eggdrop talker bot on the planet.
[14:24] <nick> !ud 2 eggdrop
[14:24] <nick> !ud 3 eggdrop
[14:24] <bot> Definition [3/4]: n/a
[14:24] <bot> Example [3/4]: WTF???!? The egg drop is f*cked up!
Back to top
View user's profile Send private message
goalie204
Halfop


Joined: 28 Apr 2011
Posts: 44

PostPosted: Sun Feb 16, 2014 7:32 pm    Post subject: Reply with quote

hey, me too, same thing.

anyone have a fix? Smile

p.s. when i tried tmyoungjr's fix - i get Tcl error [::urbandict::pub]: couldn't compile regular expression pattern: quantifier operand invalid
Back to top
View user's profile Send private message
goalie204
Halfop


Joined: 28 Apr 2011
Posts: 44

PostPosted: Mon Feb 17, 2014 7:50 am    Post subject: Reply with quote

now no matter what i do i get this error ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 4 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber