Jump to content
SSForum.net is back!

Recommended Posts

Posted (edited)

Topic says it all. Bot is based on jcnlib v 1.11

 

 

Version History:

v1.11

Fixed logic bug in autoconnect code

v1.10

Added some new features:

Auto-reconnect

Loading bot settings from a file

!die command to kill the bot.

v1.00

Released initial version

Edited by Arry

There's a wreckage,
There's a fire,
There's a weakness,
In my love
There's a hunger,
I can't control.
Hallelujah, death is overcome and we are breathing.
Hallelujah, our stone hearts become flesh that's beating.
Hallelujah, chains have been undone and we are singing.
Hallelujah, the fire has begun, can u feel it

Posted

Few things I noticed:

 

- Java will automatically use the current directory if you don't give it an absolute path to a file. The only time you need to do what you're doing is if the user is going to be running it from random directories (via shortcuts, or something), where you need to explicitly specify the install path.

 

- You've missed a curly bracket in a odd spot. I say odd because in most cases you'll get a compiler error, but in this very rare case it actually compiles (and probably works too). Unfortunately, it won't give you the result you want (See below for details).

 

1		//Main Code goes here
2		while(!objConnection.isClosed()){
3			if(objConnection.connect("67.19.122.82", 5000))
4			{
5				objConnection.login(botName, botP!@#$%^&*);
6				while(objConnection.isConnected())
7					//While the bot's connected, this thread just sleeps
8					//All the work is done in the CNConnection object
9					Thread.sleep(5000);
10				}
11				if(!objConnection.isClosed()){
12					System.out.println("Disconnected.  Waiting 30 seconds to reconnect.");
13					Thread.sleep(30000);
14					System.out.println("Attempting to reconnect...");
15				}
16			else
17			{
18				if(!objConnection.isClosed()){
19					System.out.println("Unable to connect.  Waiting 60 seconds to avoid biller login ban.");
20					Thread.sleep(60000);
21				}
22			}
23		}

 

Judging from how it's indented, it appears that line 6 is missing it's left bracket after the while-statement. This is causing the if-statement on line 3 to end at line 10 rather than line 22. The else-statement on line 16 becomes part of the if-statement on line 11 because of this as well (making it useless, as both cases are the same). If I'm right about your intentions, you're also missing the right curly bracket before the else-statement on line 16.

 

This may explain why you were having some issues with the reconnection code.

 

 

- If a connection to the server can't be made, you won't be making any login attempts which means the biller won't be banning you. Though, it's good that you're conscious of it.

 

 

None of these are real major (save for the syntax issue), but are things you should look at. Nice work, nevertheless.

D1st0rt> while(it.age < 13) { hit(it); } quit(it);

Posted

Whoa, nice catch on the syntax error. That must have fell out during a recent edit (I was moving the blocks of code around with cut and paste). Doesn't explain former problems though cause it just happened recently. I'm still surprised the compiler didn't catch it... probably because Thanks!

 

The reason I built is because eclipse runs things out of a higher level dir than the bin or src files. I wanted to ouput the full path to the console so that I knew exactly where it was looking for my cfg file.

There's a wreckage,
There's a fire,
There's a weakness,
In my love
There's a hunger,
I can't control.
Hallelujah, death is overcome and we are breathing.
Hallelujah, our stone hearts become flesh that's beating.
Hallelujah, chains have been undone and we are singing.
Hallelujah, the fire has begun, can u feel it

Posted

I see.

 

You may want to give JCreator a try. It's a much nicer IDE in my opinion, it's significantly faster than eclipse and it's just as free. It doesn't have a billion and one plugins though, but I'm guessing you aren't using any anyway.

D1st0rt> while(it.age < 13) { hit(it); } quit(it);

Posted (edited)

Lol.... I seem to have left critical parts of speech out of my post. Glad you were able to make sense out of it.

 

LOL @ probably because Thanks!

 

That's what I get for rethinking what I was going to say and then not proof reading before clicking send

Edited by Arry

There's a wreckage,
There's a fire,
There's a weakness,
In my love
There's a hunger,
I can't control.
Hallelujah, death is overcome and we are breathing.
Hallelujah, our stone hearts become flesh that's beating.
Hallelujah, chains have been undone and we are singing.
Hallelujah, the fire has begun, can u feel it

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...