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.

XE.com currency convertor script v0.02b

Support & discussion of released scripts, and announcements of new releases.
B
Bonnie
Voice
Posts: 23
Joined: Thu Dec 09, 2004 11:20 am

Post by Bonnie »

Thank you very much.
That cleared it up very nicely :)
Thanks again
Bonnie
r
romeo5k
Halfop
Posts: 46
Joined: Fri Jul 28, 2006 9:02 am

Post by romeo5k »

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: Select all

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?
Image

<<<<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
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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..
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

Post by nsrafk »

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!
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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.
n
nsrafk
Halfop
Posts: 73
Joined: Fri May 11, 2007 12:25 am

Post by nsrafk »

I dont know anything about tcl, so i cant modify it. That's why i posted in here hehe :)
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

not hard to learn if you're motivated.. I learned tcl in a few weeks.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

v0.02c

Post by rosc2112 »

Just a quick fix to remove xe.com's suddenly-anal garbage messages embedded in their data..

Same url as above.
s
stobeh
Voice
Posts: 1
Joined: Sun Aug 26, 2007 9:01 am

XE.com script no longer working

Post by stobeh »

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]} {
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

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 :)
s
shahrul
Voice
Posts: 27
Joined: Sun Mar 06, 2005 8:52 am

Post by shahrul »

Hi,

today i got this error.

Could not obtain results from XE.com, sorry!

is there anything change?
a
aa
Voice
Posts: 3
Joined: Fri Jan 08, 2010 9:12 pm

Post by aa »

I am having the same problem and have been unable to figure out what has changed.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

<speechles> !webby http://www.xe.com/ucc/convert.cgi?Amoun ... 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: Select all

	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: Select all

	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!"
	}
Last edited by speechles on Sat Jan 16, 2010 9:04 pm, edited 1 time in total.
s
shahrul
Voice
Posts: 27
Joined: Sun Mar 06, 2005 8:52 am

Post by shahrul »

Hi,

I got this problem after changing the code.

Code: Select all

Tcl error [xepub]: syntax error in expression "[regexp {>Live rates at (.*?)</span>} $html match xetime] \ ...": extra tokens at end of expression
Post Reply