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 

XE.com currency convertor script v0.02b
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Bonnie
Voice


Joined: 09 Dec 2004
Posts: 23

PostPosted: Sun Apr 29, 2007 11:02 am    Post subject: Reply with quote

Thank you very much.
That cleared it up very nicely Smile
Thanks again
Bonnie
Back to top
View user's profile Send private message
romeo5k
Halfop


Joined: 28 Jul 2006
Posts: 46

PostPosted: Wed May 30, 2007 10:46 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed May 30, 2007 3:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu May 31, 2007 4:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
nsrafk
Halfop


Joined: 11 May 2007
Posts: 73

PostPosted: Mon Jun 04, 2007 12:39 am    Post subject: Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Mon Jun 04, 2007 3:32 am    Post subject: Reply with quote

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
View user's profile Send private message
nsrafk
Halfop


Joined: 11 May 2007
Posts: 73

PostPosted: Mon Jun 04, 2007 3:35 am    Post subject: Reply with quote

I dont know anything about tcl, so i cant modify it. That's why i posted in here hehe Smile
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Mon Jun 04, 2007 3:46 pm    Post subject: Reply with quote

not hard to learn if you're motivated.. I learned tcl in a few weeks.
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Sep 09, 2007 12:06 am    Post subject: v0.02c Reply with quote

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

Same url as above.
Back to top
View user's profile Send private message
stobeh
Voice


Joined: 26 Aug 2007
Posts: 1

PostPosted: Thu Jul 10, 2008 5:18 pm    Post subject: XE.com script no longer working Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu Jul 10, 2008 6:45 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
shahrul
Voice


Joined: 06 Mar 2005
Posts: 27

PostPosted: Mon Jan 04, 2010 4:16 pm    Post subject: Reply with quote

Hi,

today i got this error.

Could not obtain results from XE.com, sorry!

is there anything change?
Back to top
View user's profile Send private message
aa
Voice


Joined: 08 Jan 2010
Posts: 3

PostPosted: Fri Jan 08, 2010 9:13 pm    Post subject: Reply with quote

I am having the same problem and have been unable to figure out what has changed.
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Sat Jan 09, 2010 9:23 am    Post subject: Reply with quote

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
View user's profile Send private message
shahrul
Voice


Joined: 06 Mar 2005
Posts: 27

PostPosted: Tue Jan 12, 2010 9:25 am    Post subject: Reply with quote

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
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  Next
Page 2 of 4

 
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