• Welcome to Valhalla Legends Archive.
 

Anaroch Experiencer

Started by ioSys, July 16, 2003, 09:58 AM

Previous topic - Next topic
|

ioSys

HELP REQUESTED:
I need help. I have found an online RPG game at www.anaroch.com for wich i am building an automated creature-killer.

The game is mainly about these 3 things:
1) team battling
2) battling 1vs1
3) killing creatures.

WHAT I HAVE SO FAR:
I have built a very simple program in vb who sends keystrokes: TAB and then ENTER to automate pressing that attack button 100.000 times. Working just fine, but requires window to have focus because its sendkeys. :(

I would like help with creating the same prg but with sendmessage API calls so that that page does not have to be active when gaining exp.


HOW BATTLING CREATURES IS DONE:
First in the battle you press a button with caption Attack.
Next there shows a link named Attack.
Next screen either shows Attack again if the creature did not die at 1 hit or a screen with a link who says: Continue.
After pressing Continue link you are back at the first page with the button with caption Attack.

How do i modify my code to send the keys to Anaroch in Internet Explorer? Here are the code i have so far. Plz help me.


Declarations in an module (sendmessage.bas)

' Find a window on the desktop
   Public Declare Function FindWindow Lib "user32" Alias _
      "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName _
      As String) As Long

' Find a window
   Public Declare Function FindWindowEx Lib "user32.dll" Alias _
   "FindWindowExA" (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, _
   ByVal lpszClass As String, ByVal lpszWindow As String) As Long
       'int = FindWindowEx(hwnd, childAfter , className , WindowName )

' Used to send messages between app's
   Public Declare Function SendMessage Lib "user32" Alias _
      "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal _
      wParam As Long, lParam As Any) As Long



...and this is in a form (form1.frm)

Private Sub Command1_Click()
   Dim TXT As Long
   Dim SM As Long
   Dim CHILD As Long
   Dim Stuff As String

If FindWindow("IEFrame", "Anaroch - Microsoft Internet Explorer") <> 0 Then
   MsgBox ("Page active"), , "Debug"

   CHILD = FindWindow("IEFrame", vbNullString) 'find dialog of ie window
       TXT = FindWindowEx(CHILD, 0, "Edit", vbNullString) 'find hwnd of the textbox
       SM = FindWindowEx(CHILD, 0, "Button", "&Send") 'find hwnd of the send button
       Stuff = Form1.Text1.Text 'add the text to a string
       
       SendMessage TXT, WM_SETTEXT, 0, ByVal Stuff 'use settext to send the text string to the textbox         'SendMessage SM, BM_CLICK, 0, 0& 'use click to click the send button on

Else
       MsgBox ("Page not active"), , "Debug"
   Exit Sub
End If
End Sub




The declarations in the module is working fine, but i need help with getting things in the commandbutton in te form right. What i want to do is (1) just pressing the attack button and (2) pressing attack link.

Thanks for help earlier. Hope you can help me with this one.

Noodlez

wow... game that can be exploited by just pressing the keys fast... talk about shitty coding

Adron


#!/bin/sh
while true; do
{
wget -B http://www.anaroch.com/ -i file --force-html --header "Cookie: [email protected]; anaroch_password=somepass" -O html
cat html
cat html|fgrep "action=battle&death=1" >file
} done

ioSys

that looks nice, but i need Windows code. Must do it in Visual Basic. The machine who is going to run that prg is a windows 98 PC.

Skywing

Quote from: ioSys on July 16, 2003, 02:06 PM
that looks nice, but i need Windows code. Must do it in Visual Basic. The machine who is going to run that prg is a windows 98 PC.
You might try Cygwin.

CupHead

Being easily amused by online games with simple exploits, I went ahead and wrote a little thing that parses the HTML and goes to the correct pages, etc.  The only problem is that occasionally the game will ask you to input a number based on an image it has displayed.  Well, damned if I'm up to writing a VB neural net to try and recognize the image.  Other than that, the program seems to work well.

Sample output:
Quote
Opening URL: anaroch.cgi?time=1058384592&action=battle&battle=1
Attack page.
Unknown page.
Opening URL: anaroch.cgi?time=1058388419&action=death
Another Fight to the Death page.
Opening URL: anaroch.cgi?time=1058388421&action=battle&death=1
Select level battle page.
Unknown page.
Opening URL: anaroch.cgi?time=1058384592&action=battle&battle=1
Attack page.
Opening URL: anaroch.cgi?time=1058388426&action=death
Another Fight to the Death page.
Opening URL: anaroch.cgi?time=1058388428&action=battle&death=1
Select level battle page.
Opening URL: anaroch.cgi?time=1058384592&action=battle&battle=1
Attack page.
Unknown page.
Opening URL: anaroch.cgi?time=1058388432&action=death
Another Fight to the Death page.
Opening URL: anaroch.cgi?time=1058388434&action=battle&death=1
Select level battle page.
Opening URL: anaroch.cgi?time=1058384592&action=battle&battle=1
Attack page.
Opening URL: anaroch.cgi?time=1058388439&action=death
Another Fight to the Death page.
Opening URL: anaroch.cgi?time=1058388441&action=battle&death=1
Select level battle page.

As you can probably see, not perfect by any means, but certainly more efficient than playing by hand.  :P

ioSys

hehe =) lets see if you fix that numberquestionprotection they have got. Maybe not worth the time and effort but fun if you make it. Is it possible to make?

how fast do your programs request that page = gain more exp?

i have built so that i can write into a textbox how many milliseconds i want it to take. its going quite fast when having 500 milliseconds. any faster than that just makes strange things. then computer dont catch up. i run at a very old comp. p166mhz.

wonder if that cygwin is to be installed =) now setup at least is complete =) it did take quite some time :)

ioSys

another thing is that a player can challange another player gaining exp and skillpoints if the player being challanged "accept" the challange.

in my case, with my program that sends its commands with vb´s sendkeys it automaticly "accepts" the challange and i loose points when i die.

i have made a timer so that the program automaticly turns off after a certain amount of minutes that one types in a textbox. if a player challanges you you can choose either to "Accept", "Decline" or "Decline all challanges for 30 minutes" making it safe to run program for 30 minutes...

CupHead

The "numberquestionprotection" thing was addressed in my last post.  My program is averaging a kill about every 6 seconds, but my bandwidth is entirely used up while I download something.  I've not been able to request the same page over and over and have it work, but I may try something like that momentarily.  If that works, then forget all of this parsing stuff.

ioSys

okey.
by the way my handle is ioSys on the game.
guess a team from this page could own the game
in notime. Teams makes it faster gaining sp + exp.
but games are evil, they eat up ones expensive time.
time that could be used earning money instead.
or meeting a nice girl. =)

Camel

Quote from: CupHead on July 16, 2003, 03:46 PMWell, damned if I'm up to writing a VB neural net to try and recognize the image.
It's actually not that hard to find an OCR plugin.

Adron

The picture is designed to be hard to OCR though...

ioSys

oh yeah!!! got my program running now. got 80.000 experience and 11.000(!!) skillpoints outplaced on attack, defence and life. damn nice! not often that numberquestion thing appears. it use to appear 2 times every 28 minutes session that im running the program. Just to keep an eye on the comp running it and restart the prg after entering that number into the textbox.

would be so cool perfecting the prg to handle that protection. =)

ioSys

hrrm..was thinking of an evil thing...is it possible to make another player accept my challange without he wanting it? =) quite bm but maybe its possible. when starting conversation one thinks of ways one not have been thinking of earlier. probably its not possible without having a client/server trojan at his comp so i can control it, but hrrm, maybe theres anothoer ways..?

Camel

Quote from: Adron on July 17, 2003, 04:34 AM
The picture is designed to be hard to OCR though...

In my limited experience with anti-ocr scripts, I have generally found that there are rarely more than 3 or 4 backgrounds placed behind plain text. Check the top left pixel; that will tell you what the foreground color is. Copy the pic pixel-by-pixel and change anything that isn't the text color to something else, and then OCR it.

|