| View previous topic :: View next topic |
| Author |
Message |
Bonnie Voice
Joined: 09 Dec 2004 Posts: 23
|
Posted: Sun Apr 29, 2007 11:02 am Post subject: |
|
|
Thank you very much.
That cleared it up very nicely
Thanks again
Bonnie |
|
| Back to top |
|
 |
romeo5k Halfop
Joined: 28 Jul 2006 Posts: 46
|
Posted: Wed May 30, 2007 10:46 am Post subject: |
|
|
| speechles wrote: | | The problem is he has 'junk' before the #comment in the very first top line. Interpreter sees that and hits the panic button and freaks out causing all this. Removing said 'junk' will solve it. |
I thought the same, but nah its not.... there is nothing on the top line at alll!!!.....
I just noticed something tho, i went ahead and just used the script as is without changing anyhing, and voila, the bot joined the channel, So between me chaning the name and deleteing the other channels like #mychan2 and #etc, something is wrong there.. Ill seee if i can solve this fender bender myself!
<<<<moments later>>>>>>
Rosc2112i figured it out... for some reason, when i try to
| Code: | bind pub - !curr xepub
bind msg - !curr xemsg |
it gives me that funny looking error, so my bot wont start. What am i doing wrong?
<<<<minutes later>>>>
This is weird... i cant do anything... If i edit one thing i get the error, if i add my channel name and delte the others, i get an error. If i change the output from XE.COM to Currency, i get error. Ask me why, i dont know.
rosc2112, may i email you so u may help me. Because i dont know if maybe im doing something wrong. Unlless we wanna start talking about UTF-8 and stuff like that, and that gets into too much depth for me. I just wanna change a couple of things |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Wed May 30, 2007 3:20 pm Post subject: |
|
|
| the problem is your editor, which I assume your using notepad instead of wordpad which is a no-no, is obviously converting your tcl to something other than raw .txt . Try using an IDE such as ConText (http://www.context.cx/) to edit your script with. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu May 31, 2007 4:51 pm Post subject: |
|
|
1) Dont post screenshots, just post the error and preferably the output of .set errorInfo, read the FAQ about how to get useful info from .set errorInfo if you don't have "set" enabled.
2) The error you posted has nothing to do with my script.
3) There's also a faq about how to load scripts so they wont crash your bot and instead show useful debug/set errorInfo.. |
|
| Back to top |
|
 |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Mon Jun 04, 2007 12:39 am Post subject: |
|
|
Hey rosc. Awesome script! I've a request though. I've seen another bot somewhere where output is different. I'd like to be able to change it into that layout.
Layout of the other bot:
USD->DKK 5.53820 (781 USD = 4325 DKK)
Compared to your script:
XE.COM: 781.00 USD equals 4,325.12 DKK as of 2007.06.04 04:39:32 UTC
I like the other layout because its much more simple. Would be nice if you could add some variables to set another layout. Im having this in mind:
$ex_rate (current exchange rate)
$amount_from (...)
$amount_to (...)
$curr_from (from currency)
$curr_to (to currency)
Would be very cool!
Thanks! |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Mon Jun 04, 2007 3:32 am Post subject: |
|
|
That alternative format makes no sense to me. If you want to know the value of 1, then input 1.
Feel free to hack on the script to suit yourself tho, I have no interest in such a modification. Give credit if you release a revision. |
|
| Back to top |
|
 |
nsrafk Halfop
Joined: 11 May 2007 Posts: 73
|
Posted: Mon Jun 04, 2007 3:35 am Post subject: |
|
|
I dont know anything about tcl, so i cant modify it. That's why i posted in here hehe  |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Mon Jun 04, 2007 3:46 pm Post subject: |
|
|
| not hard to learn if you're motivated.. I learned tcl in a few weeks. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Sep 09, 2007 12:06 am Post subject: v0.02c |
|
|
Just a quick fix to remove xe.com's suddenly-anal garbage messages embedded in their data..
Same url as above. |
|
| Back to top |
|
 |
stobeh Voice
Joined: 26 Aug 2007 Posts: 1
|
Posted: Thu Jul 10, 2008 5:18 pm Post subject: XE.com script no longer working |
|
|
looks like xe.com has changed something and the script no longer works
EDIT:
works with the following switch in the script:
&& [regexp {<td width="45%" align="right" id="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match fromamount] \
&& [regexp {<td width="45%" align="left" id="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match toamount]} {
to
&& [regexp {<td width="45%" align="right" class="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match fromamount] \
&& [regexp {<td width="45%" align="left" class="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match toamount]} { |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Jul 10, 2008 6:45 pm Post subject: |
|
|
Thanks for the heads up. I'll upload a fixed version to the url above, everyone else can just edit and incorporate the fix you posted  |
|
| Back to top |
|
 |
shahrul Voice
Joined: 06 Mar 2005 Posts: 27
|
Posted: Mon Jan 04, 2010 4:16 pm Post subject: |
|
|
Hi,
today i got this error.
Could not obtain results from XE.com, sorry!
is there anything change? |
|
| Back to top |
|
 |
aa Voice
Joined: 08 Jan 2010 Posts: 3
|
Posted: Fri Jan 08, 2010 9:13 pm Post subject: |
|
|
| I am having the same problem and have been unable to figure out what has changed. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Jan 09, 2010 9:23 am Post subject: |
|
|
| Quote: | <speechles> !webby http://www.xe.com/ucc/convert.cgi?Amount=1&From=EUR&To=USD --regexp <title>.*?rate\:\s+(.*?)\s+=\s+(.*?)</title>--
<sp33chy> webby: conflict! http-package reports: iso8859-1 .. using charset detected from html meta tagging: utf-8 to avoid conflict.
<sp33chy> regexp: capture1 ( 1.00 EUR )
<sp33chy> regexp: capture2 ( 1.44060 USD ) |
Change this part:
| Code: | if {[regexp {>Live rates at (.*?)</span>} $html match xetime] \
&& [regexp {<td width="45%" align="right" class="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match fromamount] \
&& [regexp {<td width="45%" align="left" class="XEenlarge"><h2 class="XE">(.*?)</h2></td>} $html match toamount]} {
regsub -all {<!.*?>} $fromamount {} fromamount
regsub -all {<!.*?>} $toamount {} toamount
puthelp "PRIVMSG $chan :XE.COM: \002$fromamount\002 equals \002$toamount\002 as of $xetime"
} else {
puthelp "PRIVMSG $chan :Could not obtain results from XE.com, sorry!"
} |
To make this really simple, and less likely to break in the future this scrapes the results from the title tag. So change the above to look like this:
| Code: | if {[regexp {>Live rates at (.*?)</span>} $html match xetime] && [regexp --nocase {<title>.*?rate\:\s+(.*?)\s+=\s+(.*?)</title>} $html match fromamount toamount]} {
puthelp "PRIVMSG $chan :XE.COM: \002$fromamount\002 equals \002$toamount\002 as of $xetime"
} else {
puthelp "PRIVMSG $chan :Could not obtain results from XE.com, sorry!"
} |
_________________ speechles' eggdrop tcl archive
Last edited by speechles on Sat Jan 16, 2010 9:04 pm; edited 1 time in total |
|
| Back to top |
|
 |
shahrul Voice
Joined: 06 Mar 2005 Posts: 27
|
Posted: Tue Jan 12, 2010 9:25 am Post subject: |
|
|
Hi,
I got this problem after changing the code.
| Code: | | Tcl error [xepub]: syntax error in expression "[regexp {>Live rates at (.*?)</span>} $html match xetime] \ ...": extra tokens at end of expression |
|
|
| Back to top |
|
 |
|