View previous topic :: View next topic |
Author |
Message |
spithash Master

Joined: 12 Jul 2007 Posts: 246 Location: DALnet, EFnet & Freenode
|
Posted: Wed Oct 09, 2013 9:18 am Post subject: |
|
|
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 |
|
 |
neocharles Voice
Joined: 23 Apr 2013 Posts: 34
|
Posted: Wed Oct 09, 2013 12:48 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 246 Location: DALnet, EFnet & Freenode
|
Posted: Wed Oct 09, 2013 2:31 pm Post subject: |
|
|
Trixar_za: did you update the script and forgot to update the .zip? I'm still getting that "define" error
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 |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Wed Oct 09, 2013 2:42 pm Post subject: |
|
|
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 |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 246 Location: DALnet, EFnet & Freenode
|
Posted: Wed Oct 09, 2013 3:00 pm Post subject: |
|
|
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
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 |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Wed Oct 09, 2013 3:04 pm Post subject: |
|
|
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 |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Wed Oct 09, 2013 3:41 pm Post subject: |
|
|
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 |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 246 Location: DALnet, EFnet & Freenode
|
Posted: Wed Oct 09, 2013 3:45 pm Post subject: |
|
|
hehe I did nothing, it is fully working now, good job!  _________________ DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl |
|
Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Mon Nov 04, 2013 1:46 am Post subject: |
|
|
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 |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Mon Jan 13, 2014 1:46 pm Post subject: |
|
|
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 |
|
 |
tmyoungjr Voice
Joined: 24 Aug 2007 Posts: 14
|
Posted: Mon Jan 27, 2014 1:57 pm Post subject: |
|
|
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 |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 246 Location: DALnet, EFnet & Freenode
|
Posted: Wed Jan 29, 2014 10:51 am Post subject: |
|
|
awesome, thank you!  _________________ DALnet #CodeMasters - EFnet #eggtcl Nick: spithash
Click here for troll.tcl |
|
Back to top |
|
 |
doubleu Voice
Joined: 10 Feb 2008 Posts: 11
|
Posted: Wed Feb 05, 2014 4:26 pm Post subject: |
|
|
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 |
|
 |
goalie204 Halfop
Joined: 28 Apr 2011 Posts: 44
|
Posted: Sun Feb 16, 2014 7:32 pm Post subject: |
|
|
hey, me too, same thing.
anyone have a fix?
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 |
|
 |
goalie204 Halfop
Joined: 28 Apr 2011 Posts: 44
|
Posted: Mon Feb 17, 2014 7:50 am Post subject: |
|
|
now no matter what i do i get this error ... |
|
Back to top |
|
 |
|