Sign in to follow this  
Followers 0
greenmachine

Dark Throne Recruiter

40 posts in this topic

#1 ·  Posted (edited)

I noticed many posts recently about the game DarkThrone, and every time the user wanted an AutoRecruiter script. Well, it seemed like a fun idea, and so I signed up for the game and made one. I started off with pixel searching and checking and actual mouse clicking, but I really don't like that method. I had a little bit of IE stuff in it in the first place, but not nearly enough. So I started converting the whole thing to using IE functions so it would be more reliable. Here is the result. A solid DarkThrone AutoRecruiter.

Features:

- Uses IE.au3, so "clicks" are accurate, and basically it just makes the whole job easier.

- Logs in automatically, goes to the recruit portion, recruits, and then logs out.

- Minimal user interaction required (only for the first run - three input boxes to create the INI)

Special:

- Start the program with the command parameter "bank" (no quotes) to store money in the bank after the recruit.

- Start the program with the command parameter "armory" (no quotes) to buy defensive weapons and, with the change, buy quantities of 50 miners (50 or 100).

Future Plans:

- Logging useful data (Income (per turn and total), Total cash, quantities of trained citizens in each category, etc)

- Buying other weapons/armor, including spy equipment

- Training citizens to become something other than miners (with options)

- Buy upgrades?

- Attack? (If so, it's going to be incredibly tough to work out)

- Clicking your own link (with that crazy image to process)?

Caution:

- There might be something a little weird with my recruiting, I think clicking the link "here" by text (on the error page) might be unreliable.

Please let me know what you think, and especially if anything unexpected happens.

DarkThroneRecruiter.au3

Edited by greenmachine

Share this post


Link to post
Share on other sites



Ok ive been threw every DT recruiter script i could find ive made a simple mouse clicker that partly works but none of these recruiters seem to completely work

so i was wondering if anyone cas any ideas on makeing one for Firefox that will just activate the Function on the page i belive this is the command line for the button

<form name="pibm" action="recruitloop.dt" method="get">

<input type="hidden" name="session" value="">

<input type="hidden" name="alliance" value="-1">

<input type="hidden" name="ticket" value="895810">

<input type="image" style="border=0px;" name="nextimg" id="nextimg" onclick="return validate();" src="http://www.darkthrone.com/templates/default/images/buttons/recruit2.gif">

</form>

if anyone has any ideas that could help or even point me in the right dirrection id be thankfull

Share this post


Link to post
Share on other sites

Ok ive been threw every DT recruiter script i could find ive made a simple mouse clicker that partly works but none of these recruiters seem to completely work

so i was wondering if anyone cas any ideas on makeing one for Firefox that will just activate the Function on the page i belive this is the command line for the button

<form name="pibm" action="recruitloop.dt" method="get">

<input type="hidden" name="session" value="">

<input type="hidden" name="alliance" value="-1">

<input type="hidden" name="ticket" value="895810">

<input type="image" style="border=0px;" name="nextimg" id="nextimg" onclick="return validate();" src="http://www.darkthrone.com/templates/default/images/buttons/recruit2.gif">

</form>

if anyone has any ideas that could help or even point me in the right dirrection id be thankfull

Since you're posting a support question in the thread with my recruiter, would you mind telling me what's wrong with mine before anyone considers doing something for you? Last time I checked (which happened to be a while ago) this worked fine. That's why I posted it. If you only have a support question, post in the support forum. If you have any comments, post them here.

Why do you insist on using Firefox? I really don't see what's wrong with using IE for this case. The IE.au3 library makes this so handy.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ive had no luck getting it to run its only given me error messages and i cant download the .au3 file ive tryed opening it and copying it over but i only get errors

not to mention i want something simpler something i can just open up the page myself and set to run couse the ones that log you in never seem to get me there.

Edited by Shobida

Share this post


Link to post
Share on other sites

ive had no luck getting it to run its only given me error messages and i cant download the .au3 file ive tryed opening it and copying it over but i only get errors

not to mention i want something simpler something i can just open up the page myself and set to run couse the ones that log you in never seem to get me there.

Hmm that still doesn't help me much - what errors are you getting? What version of AutoIt are you using? Do you have the IE.au3 library? Where is it located?

Be specific. Plus, if you learn the code you can modify it to do whatever you want.

Share this post


Link to post
Share on other sites

im guessing its the IE.au3 library thats my problem couse that was in the error message

Share this post


Link to post
Share on other sites

oh and i cant seem to find it either ^ ^ ive been browsing all over the forums and the site. /sigh

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

ya i got the latest beta already

thank you

Edited by Shobida

Share this post


Link to post
Share on other sites

they arent worried about beta at the moment they are releasing the new version so they dont really care what u do in beta :think:

Share this post


Link to post
Share on other sites

These kind of programs are against the Terms of service of Darkthrone, and will be detected if used...I'll personally make sure of that...

That's nice... it really isn't much of a threat to me. I only joined DT so I could make the script, so it doesn't make a difference if I play it now or not.

Plus, you'd have to find my login name first, and it's not like I'm going to tell you....

Share this post


Link to post
Share on other sites

Great script Green :think:


The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

Hey green you think you could make one for Omega as well?, i attempted using ur script and completely failed :-/ so i scrapped it :think:

Share this post


Link to post
Share on other sites

Hey green you think you could make one for Omega as well?, i attempted using ur script and completely failed :-/ so i scrapped it :think:

Chances are, no. I haven't worked on anything DT in a long while, so it's not one of my top priorities (or really even one of my bottom ones...). Plus, I'm not playing Omega, so that wouldn't work.

Share this post


Link to post
Share on other sites

well anyone that has a beta acc, automaticaly gets signed up for Omega but ill try again, it should be almost exactly the same as beta just changing form names most likely

Share this post


Link to post
Share on other sites

well anyone that has a beta acc, automaticaly gets signed up for Omega but ill try again, it should be almost exactly the same as beta just changing form names most likely

You have to be something like level 21 to play Omega.. I didn't get that far (never attacked people, too lazy to actually play the game). I'm sure it's similar, you just have to figure out what I was doing. It really shouldn't be that hard....

Share this post


Link to post
Share on other sites

well im only 11 and just bank money everyday :think: got like 4 billion spent a billion on defence but yeah so u dont have to be 21 but whatever ill give it a go :(

Share this post


Link to post
Share on other sites

omega recuiter just modified greens a lil

;===============================================================================
;
; Description:      : DarkThrone AutoRecruiter
; Parameter(s):     : Options: "bank" or "armory"
; Requirement:      : IE.au3 library and beta
; Author(s):        : Michael Guynn (greenmachine)
; Note(s):          : (c) Michael Guynn, February 2006
;
;===============================================================================

; Also deposits gold into the bank, and buys defensive weaponry and miners

; Offense weapons (best deals of all items):
; long sword base price: 300000 (+1500 offense) => 200 gold:off ratio  quantity[5]
; great sword base price: 350000 (+1800 off.) => 194.4444 gold:off ratio  quantity[6]

; Defense weapons (best deals of all items):
; long bow base price: 300000 (+1500 defense) => 200 gold:def ratio  quantity[19]
; great bow base price: 350000 (+1800 defense) => 194.4444 gold:def ratio  quantity[20]

; Each Citizen -> base guard = +6 def., costs 1500 gold => 250 gold:def ratio
; Each base guard -> trained guard = +54 def., costs 10000 gold => 185.185 gold:def ratio
; Each Citizen -> base guard -> trained guard = +60 def, costs 11500 => 191.6666 gold:def ratio

; http://www.darkthrone.com/proficiencies.dt?session=
; "levels" for use with above calculations: all %s are added/subtracted from base price/number
; search source for <td class="box_content" align="center"> -> number % is immediately after

; http://www.darkthrone.com/mining.dt?session=
; Find per-turn and daily income.
; your gold per turn is xxx,xxx,xxx.<br>
; Your daily income is xxx,xxx,xxx.<br>

;~ What are the race and subclass bonuses?
;~ Humans: +5% offense bonus, Great Sword (unique offense weapon)
;~ Elves: +5% intelligence bonus (spy offense/spy defense), Elite Archer (unique defense unit)
;~ Goblins: +5% defense bonus, Great Bow (unique defense weapon)
;~ Undead: casualty bonus (more information below), Berserker (unique offense unit)

;~ Fighter: +5% offense bonus
;~ Cleric: +5% defense bonus
;~ Thief: +5% intelligence bonus (spy defense and spy offense)
;~ Assassin: +5% income bonus

; pass decrypt _StringEncrypt (0, $AccountPassword, _StringReverse ($AccountEmail), 2)

HotKeySet ("{ESC}", "pauseme")
HotKeySet ("!q", "quitme")
#include <string.au3>
#include <ie.au3>
Opt ("WinTitleMatchMode", 2)

Global $Cursor, $Pause = 0, $Option = "", $AccountUserNumber = 0
Global $DarkThroneRecruiterINI = "DarkThroneRecruiter.ini"

If Not FileExists ($DarkThroneRecruiterINI) Then
    $AccountEmail = InputBox ("Create INI 1 of 3", "Account Email Address")
    $AccountPassword = InputBox ("Create INI 2 of 3", "Account Password")
    $AccountMainClass = InputBox ("Create INI 3 of 3", "Main Class (race) - Human, Elf, Goblin, Undead")
    $AccountPassword = _StringEncrypt (1, $AccountPassword, _StringReverse ($AccountEmail), 2)
    FileWriteLine ($DarkThroneRecruiterINI, "[Account Info]")
    FileWriteLine ($DarkThroneRecruiterINI, "Email=" & $AccountEmail)
    FileWriteLine ($DarkThroneRecruiterINI, "Password=" & $AccountPassword)
    FileWriteLine ($DarkThroneRecruiterINI, "MainClass=" & StringUpper ($AccountMainClass))
    FileWriteLine ($DarkThroneRecruiterINI, "UserNumber=")
Else
    $AccountEmail = IniRead ($DarkThroneRecruiterINI, "Account Info", "Email", "")
    $AccountPassword = IniRead ($DarkThroneRecruiterINI, "Account Info", "Password", "")
    $AccountMainClass = IniRead ($DarkThroneRecruiterINI, "Account Info", "MainClass", "")
    $AccountUserNumber = IniRead ($DarkThroneRecruiterINI, "Account Info", "UserNumber", 0)
EndIf

If $AccountEmail = "" Then
    MsgBox (0, "Error", "No Email Specified.  Please Fix INI")
    Exit
ElseIf $AccountPassword = "" Then
    MsgBox (0, "Error", "No Password Specified.  Please Fix INI")
    Exit
ElseIf $AccountMainClass = "" Then
    MsgBox (0, "Error", "No Main Class Specified.  Please Fix INI")
    Exit
EndIf

$IEObject = _IECreate (1)
;~ WinSetState ("Internet Explorer", "", @SW_MINIMIZE)
;~ TrayTip ("Dark Throne Recruiter Running", "The window flash you just saw is perfectly normal." & @CRLF & _ 
;~ "The Recruiter has to open and minimize a window." & @CRLF & "There is no need to be alarmed.", 1)
If $CmdLine[0] >= 1 Then
    $Option = $CmdLine[1]
EndIf

_IELoadWait ($IEObject, 50)
Sleep (500)
_IENavigate ($IEObject, "http://omega.darkthrone.com/", 1)
Sleep (500)
$IEFormObj = _IEFormGetObjByIndex ($IEObject, 0)
$IEFormElementEmail = _IEFormElementGetObjByIndex ($IEFormObj, 1)
$IEFormElementPassword = _IEFormElementGetObjByIndex ($IEFormObj, 2)
_IEFormElementSetValue ($IEFormElementEmail, $AccountEmail)
_IEFormElementSetValue ($IEFormElementPassword, _StringEncrypt (0, $AccountPassword, _StringReverse ($AccountEmail), 2))
$SubmitButtonSource = "templates/notloggedin/images/login.jpg"
$oInputs = _IETagNameGetCollection (_IEDocumentGetObj ($IEObject), "input")
For $oInput In $oInputs
    If $oInput.src <> "" And StringInStr ($oInput.src, $SubmitButtonSource, 0) Then
        $oInput.click
        ExitLoop
    EndIf
Next
_IELoadWait ($IEObject, 100)
Sleep (500)
If $AccountUserNumber = 0 Then
    $AccountUserNumber = GetUserNumber()
    IniWrite ($DarkThroneRecruiterINI, "Account Info", "UserNumber", $AccountUserNumber)
EndIf
If $Option = "" Then
    _IENavigate ($IEObject, "http://omega.darkthrone.com/recruitermain.dt?session=", 1)
    Sleep (500)
    _IEClickImg ($IEObject, "Start Recruiting", "alt")
    _IELoadWait ($IEObject, 50)
    Sleep (500)
    While 1
        If _IEFormGetCount ($IEObject) > 0 Then
            sleep(100)
            _IEFormSubmit (_IEFormGetObjByIndex ($IEObject, 1))
            _IELoadWait ($IEObject, 100)
            Sleep (500)
        Else
            $BodyHTML = _IEBodyReadHTML ($IEObject)
            If StringInStr ($BodyHTML, "You have already clicked the maximum number of members for today", 0) Then
                ExitLoop
            Else
                If _IEClickLinkByText ($IEObject, "here") = 0 Then
                    _IEAction ($IEObject, "refresh")
                EndIf
            EndIf
        EndIf
    WEnd
EndIf



Func GetUserNumber()
    $UserNumberSplit = StringSplit (_IEBodyReadHTML ($IEObject), '<a href="/logout.dt?session=&amp;user=', 1)
    $UserNumberSplit = StringSplit ($UserNumberSplit[2], '">', 1)
    Return $UserNumberSplit[1]
EndFunc

Func WriteSource()
    FileWrite ("RecruiterSource" & @MIN & @SEC & ".txt", _IEBodyReadHTML ($IEObject))
EndFunc


While 1
    Sleep (1000)
WEnd

Func pauseme()
    If $Pause = 0 Then
        $Pause = 1
        While 1
            TrayTip ("Paused", "The Recruiter is Paused." & @CRLF & "Press ESC to unpause or Alt+q to quit.", 1)
            Sleep (5000)
            If $Pause = 0 Then
                TrayTip ("", "", 1)
                ExitLoop
            EndIf
        WEnd
    ElseIf $Pause = 1 Then
        TrayTip ("", "", 1)
        $Pause = 0
        Return
    EndIf
EndFunc

Func quitme()
    Exit
EndFunc

Share this post


Link to post
Share on other sites

well I was running around the net searching for new "items" to play with when I found this site.. I will be doing some more digging as time allows later..

I was looking for the type of files I seen here an have after some digging an prying gotten the V3 an beta V3 installed.. I then had to do some more digging to try an locate the IE.au3 file though.. I believe it too should be updated an placed within the DL files section to ease headaches.. I used the library file T2.0-1 listed on http://www.autoitscript.com/forum/index.ph...opic=25629&st=0 an renamed it to IE.au3 so it would be recognized an still getting errors when I convert both of the codes listed here.. it converts them fine but when I try to run them it then tells me,

$oInputs = _IETagNameGetCollection (_IEDocumentGetObj ($IEObject),*input*)

$oInputs = _IETagNameGetCollection (^ERROR

yet I found a site online with a smaller IE.au3 file an used that an it runs fine.. also I am using the 3.1.1.123 beta to convert them with..

I am just trying to figure out this fun little coding world here so try to not over whelm me to much so :">.. plus if need be I could also offer ideas to help press the final stages you had planned originally for this code project.. as in letting the app pull the prices for the armory items off the site instead of listing them in the code.. I have been trying to work on a equation that would help to count out an time banking processes too.. but that isn't going as well as I hoped.. I don't have codes just ideas though.. also would be a nice trick to maybe make a "profile manager" on it to allow those either with multiple accounts or watching others accounts to be able to load the logins an settings in for them within one setup..

an who knows maybe even using the same feature to grab the info from the members page to add a repair feature into the final project as well.. an maybe a adjustable login timer/refresh to check the stats too.. as I said loaded with ideas, just no knowledge to do it on my own is the sad fact..

also I would like to know if anyone has gotten an idea about the omega validation window deal?.. it is basically like the external recruiting link selection window is (click the name that appears twice).. but it appears at random times though.. I have heard rumor that some have found ways around it so wanted to ask these great minds if they could also :(..

I do realize this is a toy for all who are messing with it, but just want to try an offer ideas to maybe make it a working project for all who use it to enjoy more so :oops:.. I have another old project source code some else wrote ages back I still use, but I know nothing of how to tweak it if or when it dies :D.. so I wanted to reach out to those who are enjoying the game an also working on projects like these to see if they would an can help to make newer an tighter toys :(.. the old project has a profiling system an a banking feature in it, but it has to log in an out to refresh the pages, an it doesn't time the gold per turn to know when to go in an bank.. so it is dangerous at times (can alert server admins) it logs in to often to try an bank max gold on farm bases.. also it doesn't drop the dll memory cache used an slowly drains system resources.. an then if you have several accounts loaded into it then it will cross them up an end up banking the wrong amount on the wrong base an messes up you gold per day/deposits per day ratio.. so as I said it needs work also, but I know nothing about how to though.. it is also done in I believe C#.. but being a "noob" to it don't take my word that is what it is.. I know I can compile/build it in VS8 am it work is all I can tell you..

I will be keeping an eye out here an on other threads like this an slowly digging to see if I can learn this method of coding easier than trying to learn C++ or C#.. an who knows maybe combined we can turn out a fun little project on this venture..

oh, this isn't my DT name :bike:.. I am not that foolish :)..

oh I will also add the smaller IE.au3 file I used that worked so you can compare them to help you to trouble shoot the issue I mentioned..

IE.au3

Share this post


Link to post
Share on other sites

when i run it, it goes reallllly slowly. I am new to Autoit and this is the first script i have tried so i dont know if i have done everything right. how long does it take someone else for it to do all 350 clicks using this script (the one for DT beta not omega)?

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0