This is a neopets login I wrote in Perl. If you haven't already, you will need to download Perl from activestate, and you will need to download the HTTP and LWP modules from CPAN. Code (Perl): <div class="perl" id="{CB}" style="font-family: monospace;"><ol><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #808080; font-style: italic;">#!/usr/bin/perl</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #000000; font-weight: bold;">use</span> LWP;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #000000; font-weight: bold;">use</span> HTTP::<span style="color: #006600;">Cookies</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #000000; font-weight: bold;">use</span> HTTP::<span style="color: #006600;">Headers</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$baseurl</span> = <span style="color: #ff0000;">"http://neopets.com"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$regexlogin</span> = [url=http://perldoc.perl.org/functions/qr.html]<span style="color: #000066;">qr</span>[/url]/Current\[url=http://perldoc.perl.org/functions/s.html]<span style="color: #000066;">s</span>[/url]*Competitions/;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$regexlogindata</span> = [url=http://perldoc.perl.org/functions/qr.html]<span style="color: #000066;">qr</span>[/url]<span style="color: #66cc66;">{</span>Welcome, <a class=tl href=/randomfriend\.phtml\?user=<span style="color: #66cc66;">(</span>.+?<span style="color: #66cc66;">)</span>><span style="color: #66cc66;">(</span>?:.+?<span style="color: #66cc66;">)</span></a> \|\nPet : <a class=tl href=/quickref\.phtml><span style="color: #66cc66;">(</span>.*?<span style="color: #66cc66;">)</span></a> \|\nNP : <a class=tl href=/objects\.phtml\?type=inventory><span style="color: #66cc66;">(</span>.*?<span style="color: #66cc66;">)</span></a><span style="color: #66cc66;">}</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$regexloginerr</span> = [url=http://perldoc.perl.org/functions/qr.html]<span style="color: #000066;">qr</span>[/url]<span style="color: #66cc66;">{</span>That\[url=http://perldoc.perl.org/functions/s.html]<span style="color: #000066;">s</span>[/url]*<.*>\[url=http://perldoc.perl.org/functions/s.html]<span style="color: #000066;">s</span>[/url]*<.*>\[url=http://perldoc.perl.org/functions/s.html]<span style="color: #000066;">s</span>[/url]*<span style="color: #66cc66;">(</span>.*<span style="color: #66cc66;">)</span>\[url=http://perldoc.perl.org/functions/s.html]<span style="color: #000066;">s</span>[/url]*<.*>\[url=http://perldoc.perl.org/functions/s.html]<span style="color: #000066;">s</span>[/url]*<.*>\[url=http://perldoc.perl.org/functions/s.html]<span style="color: #000066;">s</span>[/url]*combination is invalid\.<span style="color: #66cc66;">}</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ua</span> = LWP::<span style="color: #006600;">UserAgent</span>-><span style="color: #006600;">new</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0000ff;">$ua</span>-><span style="color: #006600;">env_proxy</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0000ff;">$ua</span>-><span style="color: #006600;">agent</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7"</span><span style="color: #66cc66;">)</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #0000ff;">$ua</span>-><span style="color: #006600;">cookie_jar</span><span style="color: #66cc66;">(</span>HTTP::<span style="color: #006600;">Cookies</span>-><span style="color: #006600;">new</span><span style="color: #66cc66;">)</span>; <span style="color: #808080; font-style: italic;"># Use cookies.</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/push.html]<span style="color: #000066;">push</span>[/url] @<span style="color: #66cc66;">{</span><span style="color: #0000ff;">$ua</span>-><span style="color: #006600;">requests_redirectable</span><span style="color: #66cc66;">}</span>, <span style="color: #ff0000;">'POST'</span>; <span style="color: #808080; font-style: italic;"># Allow POST requests to be redirected by the server for login.</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span> . <span style="color: #ff0000;">'Where do you want the logfile saved? (eg. c:\log.txt) : '</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/chomp.html]<span style="color: #000066;">chomp</span>[/url]<span style="color: #66cc66;">(</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$log</span> = <span style="color: #009999;"><STDIN></span><span style="color: #66cc66;">)</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>-e <span style="color: #0000ff;">$log</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/open.html]<span style="color: #000066;">open</span>[/url] LOG, <span style="color: #ff0000;">">>"</span>, <span style="color: #0000ff;">$log</span> <span style="color: #b1b100;">or</span> [url=http://perldoc.perl.org/functions/die.html]<span style="color: #000066;">die</span>[/url] <span style="color: #ff0000;">"Unable to open (existing) logfile for output... $!<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #66cc66;">}</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/open.html]<span style="color: #000066;">open</span>[/url] LOG, <span style="color: #ff0000;">">"</span>, <span style="color: #0000ff;">$log</span> <span style="color: #b1b100;">or</span> [url=http://perldoc.perl.org/functions/die.html]<span style="color: #000066;">die</span>[/url] <span style="color: #ff0000;">"Unable to open (non-existant) logfile for output...$!<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #66cc66;">}</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>You now need to provide your neopets login details.<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"Enter your neopets username: "</span>; [url=http://perldoc.perl.org/functions/chomp.html]<span style="color: #000066;">chomp</span>[/url]<span style="color: #66cc66;">(</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$username</span> = <span style="color: #009999;"><STDIN></span><span style="color: #66cc66;">)</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"Enter your neopets password: "</span>; [url=http://perldoc.perl.org/functions/chomp.html]<span style="color: #000066;">chomp</span>[/url]<span style="color: #66cc66;">(</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$password</span> = <span style="color: #009999;"><STDIN></span><span style="color: #66cc66;">)</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>Thank you... I now have all the information required.<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"When you want me to log in with your username/password, press enter... "</span>; <span style="color: #009999;"><STDIN></span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">&login<span style="color: #66cc66;">(</span><span style="color: #0000ff;">$username</span>, <span style="color: #0000ff;">$password</span><span style="color: #66cc66;">)</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;">[url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>When you would like me to start refreshing (every $rfrate seconds), press enter..."</span>; <span style="color: #009999;"><STDIN></span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"><span style="color: #000000; font-weight: bold;">sub</span> login<span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>Logging in with $username and $password...<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$loginurl</span> = <span style="color: #0000ff;">$baseurl</span> . <span style="color: #ff0000;">"/login.phtml"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$post</span> = <span style="color: #0000ff;">$ua</span>-><span style="color: #006600;">post</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$loginurl</span>,</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">[</span><span style="color: #ff0000;">"username"</span> => <span style="color: #0000ff;">$username</span>,</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #ff0000;">"password"</span> => <span style="color: #0000ff;">$password</span>,</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">]</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">)</span>; </li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$post</span>-><span style="color: #006600;">is_success</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$post</span>-><span style="color: #006600;">content</span> =~ <span style="color: #0000ff;">$regexlogin</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"Logged in succesfully.<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #b1b100;">if</span><span style="color: #66cc66;">(</span><span style="color: #0000ff;">$post</span>-><span style="color: #006600;">content</span> =~ [url=http://perldoc.perl.org/functions/m.html]<span style="color: #000066;">m</span>[/url]<span style="color: #66cc66;">{</span><span style="color: #0000ff;">$regexlogindata</span><span style="color: #66cc66;">}</span>mi<span style="color: #66cc66;">)</span><span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>Logged in as: $1, with pet: $2, and you currently have $3 NP!<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">}</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"Unable to retrieve login data.<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">}</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">}</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] <span style="color: #ff0000;">"Could not log in; username and/or password invalid.<span style="color: #000099; font-weight: bold;">\n</span>"</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$post</span>-><span style="color: #006600;">content</span> =~ <span style="color: #0000ff;">$regexloginerr</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] LOG [url=http://perldoc.perl.org/functions/localtime.html]<span style="color: #000066;">localtime</span>[/url]<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> . <span style="color: #ff0000;">" : Invalid: '$username'/'$password', unable to login.<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/exit.html]<span style="color: #000066;">exit</span>[/url];</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">}</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">}</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">{</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/die.html]<span style="color: #000066;">die</span>[/url] <span style="color: #ff0000;">"Error: "</span>, <span style="color: #0000ff;">$post</span>-><span style="color: #006600;">status_line</span>;</li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> [url=http://perldoc.perl.org/functions/print.html]<span style="color: #000066;">print</span>[/url] LOG [url=http://perldoc.perl.org/functions/localtime.html]<span style="color: #000066;">localtime</span>[/url]<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> . <span style="color: #ff0000;">" : There was an error logging in...<span style="color: #000099; font-weight: bold;">\n</span>"</span>;</li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">}</span></li><li style="padding: 0 5px; background-color: #fff; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> <span style="color: #66cc66;">}</span></li><li style="padding: 0 5px; background-color: #f9f9f9; line-height: 16px; border-bottom: 1px solid #efefef; border-left: 1px solid #999;"> </li></ol></div>
I think ill do something like this for VB6? Or am i the only one that has VB6 it seems everyone around here has .NET or perl =/
Ohh. Well i still havent seen anyone else that uses VB ... Except Cheesie, but then again i dont really know everyone here/
Looks like a nice wrapper mystical.. I might try using it in my next app, instead of the messy code I use at the moment lol. Thanks
yeah I seen your code and was like :? so figured I'd just put that 1 up. I'll see if i still have my ocr in .net and I'll post the code in the ocr thread if I do.
I got some questions... 1. Is this compatible with VB5 Express downloaded off internet. 2. If not, are there any free vb.net? 3. What link please?