Teen Programmers Unite  


Return to forum top

Help with Java/Perl scripts......

Posted by Shadows [send private reply] at September 17, 2002, 11:12:41 AM

Hello! This is for a school project on how to make an internet game, program, ect. faster and more efficient.
I am attempting to make a script that will allow me a faster way to enter classes, and have heard that what I am looking to to may be either Perl or a combination of Perl/Javascript, which is what my existing script is written in.

The game is www.horseland.com and the main onjective of the game is to enter your horses in as many classes as possible. BUT, it is an extremely long and boring task to enter them in each show by clicking on each button.

I am trying to create a script that allows me to enter all of these classes with the click of one button....instead of many .

Here is the script that I have so far.....

<script language="JavaScript"> <!--

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
return false;
if (document.layers) {
if (e.which == 3) {
return false;
if (document.layers) {
// --> </script>
<font face="times new roman"><Br><Br><center>
function enter(classNum)
enterhorse.class_id.value = Number(enterhorse.class_id.value) + 1;
enterhorse.key.value = Number(enterhorse.key.value) + 4;
enterhorse.key2.value = Number(enterhorse.key2.value) + 4;
enterhorse.key3.value = Number(enterhorse.key3.value) - 8;
enterhorse.key5.value = Number(enterhorse.key5.value) +0;
enterhorse.key4.value = Number(enterhorse.key4.value) ;
enterhorse.key6.value = Number(enterhorse.key6.value) ;
if(enterhorse.lastclass.value > classNum)
setTimeout("enter(enterhorse.class_id.value)", 900);

<Form name="enterhorse" action="http://www.horseland.com/Scripts/ENTERHORSE.asp" method="POST" target=main>

<!--<input TYPE="submit" STYLE='font-weight:normal;font-size:10px;' VALUE="Enter this horse" >-->
<B><center>Horse ID</center></B>
<input type="text" value='horse_id' name='horse_id'>
<input type="text" value='class_id' name='class_id'>
<input type="text" name=lastclass value=last_class>
<input type="text" value='first_key' name='key'>
<input type="text" value='second_key' name='key2'>
<input type="text" value='third_key' name='key3'>
<input type="text" value='fifth_key' name='key5'>
<input type="text" value='fourth_key' name='key4'>
<input type="text" value='sixth_key' name='key6'>


<Button onclick=enter(enterhorse.class_id.value)>Enter Horse</Button>



Here is a link to the page, if you would like to insert the numbers below to see that the process of the script is.


And here are some values to enter for the keys (taken from the view source)........

*<input type="hidden" value='5897491' name='class_id'>
*<input type="hidden" value='2308748' name='horse_id'>
*<input type="hidden" value='700130518' name='key'>
*<input type="hidden" value='25898712' name='key2'>
*<input type="hidden" value='-44871180' name='key3'>
*<input type="hidden" value='4' name='key5'>
*<input type="hidden" value='F97CA7' name='key4'>
*<input type="hidden" value='73D7F9' name='key6'>

Here is a set of values from the next class number:

*<input type="hidden" value='5897492' name='class_id'>
*<input type="hidden" value='2308748' name='horse_id'>
*<input type="hidden" value='700130522' name='key'>
*<input type="hidden" value='25898716' name='key2'>
*<input type="hidden" value='-44871188' name='key3'>
*<input type="hidden" value='4' name='key5'>
*<input type="hidden" value='897CA7' name='key4'>
*<input type="hidden" value='0A73D7' name='key6'>

I need to figure out the intervals for the 4th and sixth keys.......they are alphaneumeric and have an interval....but I can't figure out what it is.

Also, how can I avoid the denial of service attack?

I know this is a big undertaking........but it is one I have tried for a LONG time.....and just need help with! :)

Posted by diegoeskryptic [send private reply] at September 17, 2002, 12:58:17 PM

LOL>.. you are asking for a bit too much here.... this is the most code I have ever seen printed at one time.... First of all.. here at TPU.. they do not do homework.. and i think there is a limit on how much code to post....

Posted by Neumann [send private reply] at September 17, 2002, 01:08:34 PM

diego, stop whining. Those people need help. If you can't answer, just don't.

Or at worse a simple warning (it's not the case here), would be enough most of the time.

Posted by mop [send private reply] at September 17, 2002, 06:13:13 PM

"Also, how can I avoid the denial of service attack?"

That makes it sound like your going to be the target of one, if someone has taken the time to orgranize one against you for whatever reason and you really value the speed of your internet whilst your not being bogged down, and can't wait for the person to just get bored, then there isn't much you can do. That is if you just mean just against your personal computer, and your not serving any files that people are vitally dependant on then I wouldn't care. Even script kiddies would think thats useless!

Well actually, I don't know much about DoSing, but depending on the type of request (I'm guessing one would use pinging) could you just plug up the target ports?

Posted by buzgub [send private reply] at September 18, 2002, 12:17:52 AM

I think you need to design a seperate user interface for this, where the interface's priority is to allow easy selection of multiple things to enter, probably by having one page with a list of things and abbreviated options. That should make it fairly easy to do what you want.

Posted by DragonWolf [send private reply] at September 18, 2002, 05:09:50 AM

At work don't have time to go through the code above, I'll post answer later if no one else has.

This doesn't really class as an doing homework I don't think cause its PART of a project, and besides he already has the code done, just needs a few tweaks.

As for the length of the code, ya I think its a bit long ^^ a link to a source file on your website would have sufficed.

You must be logged in to post messages and see which you have already read.

Log on
Save for later automatic logon

Register as a new user
Copyright TPU 2002. See the Credits and About TPU for more information.