I need a web based auto account

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 095. Note: Core 095 is no longer officially supported.
Post Reply
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

I need a web based auto account

Post by Avenging Angel »

Can someone help me with that please. Thanks.
Dev Impy
Neophyte Poster
Posts: 30
Joined: Thu Aug 10, 2006 6:38 am

Post by Dev Impy »

Didnt i jusay to some one i woul dhelp them on another post. do a search.
think theres a script lying around somewhere.
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

The script I found would not compile so I still need some assitance please.
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

Here is the script i found here I need to know why it dont work
use http;
use uo;

program CreateAccount( )
// Make a password check
// The URL should look like this: http://tribulation.sytes.net/pkg/webadm ... sswordHere
// You can replace "YourPasswordHere" with a function to get a password from a config file if you like
if ( QueryParam( "admin" ) != "YourPasswordHere" )
// More bark than bite
print( "Warning: Unauthorized account creation attempt." );
WriteHeader( );
WriteHtml( "Warning: Your IP has been logged and the Admin has been notified!");
WriteFooter( );
return;
endif

// Setup the variables
var name := QueryParam( "name" );
var pass := QueryParam( "pass" );
var email := QueryParam( "email" );
var lbr := QueryParam( "LBR" );

WriteHeader( );

// Check to see that we have all three fields
if( !name or !pass or !email )
WriteHtml( "Error: The name, password or e-mail address field was blank.<br>\n" );
WriteFooter( );
return;
endif

// Do a little illegal character checking
while ( name["+"] )
name["+"] := " ";
endwhile

while ( pass["+"] )
pass["+"] := " ";
endwhile

while ( email["+"] )
email["+"] := " ";
endwhile

// Create the account & set e-mail address
var ret := CreateAccount( name, pass, 1 );
ret.setprop( "email", email );

// Uncomment this if you want to see this on the console
//print( "Account: " + name + " created. LBR value: " + lbr );

// Set account as LBR if requested
if ( lbr )
ret.setprop( "LBR", 1 );
endif

if ( ret == error )
WriteHtml( "Error: Account creation failed.<br>\n" );
WriteHtml( "Details: " + ret.errortext + "<br>\n" );
else
WriteHtml( "Account added successfully!" );
endif

WriteFooter( );
endprogram

function WriteHeader( )
WriteHtml( "<html>\n<head>\n<title>Account Creation</title>\n\n<body>\n\n" );
endfunction

function WriteFooter( )
WriteHtml( "\n\n</body>\n</html>" );
endfunction
Thanks for your help.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

well, theres more to the address than what the author put and I'm not sure what type of system the author developed it for since if a player does this, they would see the Admin Password in the address bar. So heres how I would do it but I dont know what security options you want and such in terms of limiting how many accounts someone can actually create...

If you dont have a specific need to have an admin password, Remove

Code: Select all

if ( QueryParam( "admin" ) != "YourPasswordHere" )
// More bark than bite
print( "Warning: Unauthorized account creation attempt." );
WriteHeader( );
WriteHtml( "Warning: Your IP has been logged and the Admin has been notified!");
WriteFooter( );
return;
endif 
then I would create a simple webpage form that asks for the username, password, and email address. Then when they hit submit, it will go to (replace parentheses with whats needed of course)

http://(server IP:Port)/(script).ecl?name=(username)&pass=(password)&email=(email)

as for the LBR prop, if your shard uses the "LBR" account prop, then append to the address (without quotes) "&LBR=(LBR value)", otherwise, you can remove

var lbr := QueryParam( "LBR" );

and

// Set account as LBR if requested
if ( lbr )
ret.setprop( "LBR", 1 );
endif
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

use http;
use uo;

Program Create_Account( )
// Make a password check
// The URL should look like this: http://avenginguo.dnsalias.net:6060/account.html
// You can replace "YourPasswordHere" with a function to get a password from a config file if you like
// Setup the variables
var name := QueryParam( "name" );
var pass := QueryParam( "pass" );
var email := QueryParam( "email" );

WriteHeader( );

// Check to see that we have all three fields
if( !name or !pass or !email )
WriteHtml( "Error: The name, password or e-mail address field was blank.<br>\n" );
WriteFooter( );
return;
endif

// Do a little illegal character checking
while ( name["+"] )
name["+"] := " ";
endwhile

while ( pass["+"] )
pass["+"] := " ";
endwhile

while ( email["+"] )
email["+"] := " ";
endwhile

// Create the account & set e-mail address
var ret := CreateAccount( name, pass, 1 );
ret.setprop( "email", email );

// Uncomment this if you want to see this on the console
//print( "Account: " + name + " created. LBR value: " + lbr );


if ( ret == error )
WriteHtml( "Error: Account creation failed.<br>\n" );
WriteHtml( "Details: " + ret.errortext + "<br>\n" );
else
WriteHtml( "Account added successfully!" );
endif

WriteFooter( );
endprogram

function WriteHeader( )
WriteHtml( "<html>\n<head>\n<title>Account Creation</title>\n\n<body>\n\n" );
endfunction

function WriteFooter( )
WriteHtml( "\n\n</body>\n</html>" );
endfunction
Ok for some reason its not creating any accounts why is this?
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

are you able to access the script correctly? Are you sure the address is formatted exactly how I told you replacing the parentheses with what is needed? Give me an example URL that you're generating for your script.
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

<FORM action="http://avenginguo.com:6060/autoaccount.ecl"
method="GET">
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

here is the html code i am using
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Avenging Legends Account Creator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style4 {color: #FF0000}
.style6 {color: #999999; font-size: 12px; font-weight: bold; }
.style1 { color: #999999;
font-size: 12px;
}
.style10 {font-size: 12px}
-->
</style>
</head>

<body bgcolor="#151517" text="#FFFFFF" link="#FFFFFF" vlink="#FF0000" alink="#FFFFFF">
<FORM action="http://avenginguo.com:6060/autoaccount.ecl"
method="GET">
<p align="left"><font color="#FFFFFF" size="2" face="Verdana"><span class="style4">*<span class="style6">Apply for an account</span> </span></font></p>
<div align="center">
<table width="360" border="0" align="center" cellpadding="0" cellspacing="5" bordercolor="#000000">
<tr>
<td width="87"><div align="center"> <span class="style1">Accountname</span></div></td>
<td width="250"><input name=acctname style="HEIGHT: 25px; WIDTH: 250px" size="15" maxlength="15"></td>
</tr>
<tr>
<td><div align="center" class="style10">
<font color="#FFFFFF"><span class="style1">Password</span></font></div></td>
<td><input name=acctpass type="password" style="HEIGHT: 25px; WIDTH: 250px" size="15" maxlength="15"></td>
</tr>
<tr>
<td width="87"><div align="center"> <span class="style1">Email</span></div></td>
<td width="250"><input name=acctname style="HEIGHT: 25px; WIDTH: 250px" size="30" maxlength="30"></td>
</tr>
<tr>
<td height="26" colspan="2"><div align="center">
<input id=reset12 name=reset1 type=reset value=Cancel>
&nbsp;&nbsp; <strong></strong> <strong></strong>
<input id=submit12 name=submit1 type=submit value='Create'>
</div></td>
</tr>
</table>
<font face="Verdana"></font></div>
<p align="center" class="style1" font color="#FFFFFF" size="2" face="Verdana"></p>
<p align="center" class="style1"></a></strong></font>
</div>
Remember that the password and login will be stored on the Server!<br>
Also remember to change your email ingame, in case you shuld lose you accinfo to recover it! (.email) </p>
<p align="center" class="style1">You can login direct after creating the account! <br>
<br>
Also remember to read the rules before logging in on Avenging Legends, Developer Avenging Angel. </p>
</FORM>
</body>
</html>
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

ok now append what you need on the end of autoaccount.ecl...

autoaccount.ecl?name=(username they entered)&pass=(password they entered)&email=(email they entered)
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

autoaccount.ecl?name=(username they entered)&pass=(password they entered)&email=(email they entered)

like that or

autoaccount.ecl?name=&pass=&email=

i ask because its still not making the accounts. I am sure i am missing something.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

ok... like if I entered in the form

Username: CWO
Password: testpass
Email: Testing@testing.com

the address should look like this...

autoaccount.ecl?name=CWO&pass=testpass&email=Testing@testing.com
Last edited by CWO on Tue Sep 26, 2006 7:39 pm, edited 1 time in total.
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

it does say that then takes me to a blank screen.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

I would start adding Print() lines at the beginning and at the end to see what info it has in the variables and where it possibly stops.
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

http://avenginguo.com:6060/autoaccount. ... it1=Create

when I hit submit it has this link. So whats wrong?
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

variable names are wrong...

acctname=
acctpass=

should be

name=
pass=

and you have

acctname=

again for the email address... it should be

email=
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

Basically in the webpage address after .ecl you put the question mark. This means that there are variables being declared after it. Now the syntax for declaring a variable is

varname=value

and they are seperated by

&

so the variables are declared and given their values in the address. The script now needs to receive these variables from the address and set them to EScript variables for use within the script. This is what

var name := QueryParam( "name" );

is for. It looks for

name=...

in the address. Thats how they are translated from the address into the script so whats in the address must match what QueryParam is looking for.
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

I have this
var name := QueryParam( "name" );
var pass := QueryParam( "pass" );
var email := QueryParam( "email" );
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

yes I know... Thats why I told you to look at the address again and change what the names are in the address. Or you can change them in QueryParam.
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

This script I have to create an account from a web page is not working at all. Can someone please give me a script that will work please.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

do you have that script still up? I'll try to make an account and see. It should work just fine...
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

Not sure how useful this will be.. but there is an accounts package in the distro that has various account creation methods in it that you can learn from.

http://svn.sourceforge.net/viewvc/pol-d ... iew=markup
Avenging Angel
Neophyte Poster
Posts: 33
Joined: Sat Aug 19, 2006 12:47 pm

Post by Avenging Angel »

i am using this script now but it wont compile why?
use uo;
use os;
use http;

include ":accounts:accounts";
include ":accounts:settings";

/* NOTES:
*
* Expects a URL string with info for the following
* username=username (string)
* password=password (string)
* cmdlevel=default command level (integer)
* expansion=expansion (string)
* email=email ( string)
* adminpw=creation password (string) - if set in settings.cfg
*
* Example:
* ?username=Bob&password=Beer&cmdlevel=3&expansion=AOS&email=Bob@beer.org&adminpw=DistroR0x
*
*/
program HTTPScript()
var settings := ACCT_GetSettingsCfgElem("Settings");
if ( !settings.AllowWWWAccounts )
WriteHTMLRaw("Error: Web account maker is disabled.");
return 0;
endif

var username := QueryParam("username");
var password := QueryParam("password");
var cmd_lvl := QueryParam("cmdlevel");
var expansion := QueryParam("expansion");
var email := QueryParam("email");
var admin_pw := QueryParam("adminpw");

if ( settings.AuxWebPassword )
if ( settings.AuxWebPassword != admin_pw )
WriteHTMLRaw("Error: Invalid administration password.");
return 0;
endif
endif

var result := CreateNewAccount(username, password, cmd_lvl, expansion, email);
if ( result.errortext )
WriteHTMLRaw("Error: "+result.errortext);
else
WriteHTMLRaw("Success: The acount was created successfully.");
endif

return
endprogram
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

it might be with an include. I still think the old one was fine just as you posted it but the link you generated and posted afterwards was wrong.
Post Reply