-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|725|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Misc


 
flying_cucco
Created : 24 February 2007
Edited : 12 September 2009
System : Windows
Language : Blitz

Cucco's Inselkampf Bot

Yet another inselkampf bot

The code for the bot has been removed. I no longer play IK and in any case wouldn't condone cheating of that sort

Later, I expanded on the idea to make a set of 'tools' to collect and analyse statistical information about the game, and make that available to other players. You can download them here.

 

Comments


Saturday, 24 February 2007, 10:34
shroom_monk
Erm... sorry Diablos and cucco, but I think I'm about to throw a rather large mushroom-shaped spanner into the works here:

Inselkampf Rules §4 Programs that automate processes in the game, change the surface of the game or generate an exorbitant number of hits are strictly forbidden on all pages of the INSELKAMPF website.


Doesn't that mean that your bots break the rules?
Saturday, 24 February 2007, 10:46
flying_cucco
.
Saturday, 24 February 2007, 13:05
JL235
I got a memory access error when I tried to test it.

But does yours needs the session id to be manually in-putted too? This is a huge flaw in both our designs. If we can find a way to log in automatically, my bot will be (almost) complete.

Shroom: I'm only making it to see if I can, not to cheat and win or anything.
Saturday, 24 February 2007, 13:24
flying_cucco
.
Saturday, 24 February 2007, 13:35
JL235
Honestly, I don't think Blitz is the best language to do this. Partly because mine reads the page, and regular expressions help ALOT when doing this.
Saturday, 24 February 2007, 16:04
garand
I dont know much at all about what you people are talking about but what if you had the program access the specific input box on the page for the username and password and inputted it that way? Again, I have no idea what I am talking about!
Saturday, 24 February 2007, 17:28
JL235
We'd need someone like Stealth or Jay who know about PHP to help with this. But I'd really like to get my bot working.
Saturday, 24 February 2007, 18:12
flying_cucco
.
Saturday, 24 February 2007, 18:18
JL235
I find it's made for games, and that's about it. Don't get me wrong, making games is easiest in Blitz because all the drawing is simplified and easy to use. But anything else isn't as support as with most other languages. Especially if you want to do stuff with strings, your quite limited. Even basic stuff like checking if one string inside another is missing.

Personally my full approach will include reading the whole page. I also plan my bot (after testing) to have no graphics and work purely as a background process, something you cannot do in Blitz.

I'd probably have the bot start on startup, and run it for month before I check how it's progressed. Then I'd probably forget it.
Saturday, 24 February 2007, 18:36
HoboBen
Perhaps experiment with this for logging in... it worked for me, typing in the address.


Saturday, 24 February 2007, 19:08
flying_cucco
.
Saturday, 24 February 2007, 19:12
HoboBen


Well, I had no idea how to format the POST HTTP/1.0 bit. I had RFC2616 or something open looking for the POST part, but gave up on the skimming
Saturday, 24 February 2007, 19:19
flying_cucco
.
Saturday, 24 February 2007, 19:26
HoboBen
AFAIK...

GET is when you have a url like index.php?variable=1

and PHP will use a get function to grab the variable.

POST is when you PHP accepts things from a posted form to grab a variable.

I used my web developer firefox extension to convert POST > GET (rather than wade through source, picking up each variable I needed), and got the URL, thinking it wouldn't work and you'd have to have Blitz POST it rather than my browser send things via the GET method...

But inselkampf seems to accept both GETs and POSTs, which is asking for bots, really... I don't think things usually accept GETs when they're asking for POSTs.

|edit| If that made any sense at all, I'm chuffed |edit|
Saturday, 24 February 2007, 20:21
JL235
Ok, I was wrong about that string search thing. I'll retract that statement, I honest never knew it was in Blitz.

But anyway, I'm having trouble getting this to work. I had to remove the 'HTTP/1.0' bit to get it to send properly. But I get nothing back.
Saturday, 24 February 2007, 21:56
flying_cucco
.
Saturday, 24 February 2007, 23:24
JL235
Verification that 'HTTP/1.0' is required has helped, thanks. But the fix for the error to send two '\n', rather then just one. I am receiving the information now, and should have my Inselkampf bot working hopefully by the end of the day (as I currently have real work to do).

Also would it not be better to have 'delay next_update' rather then a delay in a loop?
Sunday, 25 February 2007, 12:16
power mousey
Island Ruler Mousey...

me Big Cheese!

doen't need bots, crap codes.
dem workers respect me.
give dem gold,stone and wood
and lots of cheese to build my empire.
Thursday, 12 April 2007, 10:43
Blitz3Dman
In my opinion what would be the best language for something like this
Thursday, 12 April 2007, 10:57
JL235
You can simulate mouse clicks (and I'd presume keystrokes) with the Win32 API, which you could use with pretty much any language. Blitz wouldn't be a good choice because it doesn't have much support for the kind of things you might use with an application, like regular expressions.

As for languages, I'd say C# would be best. Wouldn't suprise me if their were already some Win32 interface stuff made for C# (like with Managed Direct X). But if I knew a lot more about Win32, I'd personally use Ruby. I've done pop-up dialogues with it, but that's about it.

Although I'd expect they used C++ to make that.
Thursday, 06 September 2007, 02:24
Jayenkai
FFS.
I gotta start adding some kind of Wiki-esque logs of changes, now.
What a waste of database.
Thursday, 06 September 2007, 04:21
JL235
I have a better Inselkampf bot I've been meaning to finish and update. Although I don't play on World 1 anymore, and it doesn't work on World 2.