Sign in to follow this  
Followers 0
Insomniac

9Dragons AFK Skill Trainer

6 posts in this topic

This isnt a help request per se, but I couldnt post this on the example scripts board, so I thought Id put it up here.

After having played 9Dragons (a Kung-Fu MMORPG, for those that doesnt know this game) for a while, I have ran into long sessions of time where all I do is mash 1 button, in order to increase its efficiency. In order to combat this to make use of my time better, such as reading a book, review some language materials, whatnot, I started looking into script/applications that could do this for me, and found AutoIt, as well as a few very crude examples, that didnt do the job fully. I then decided to write my own, and here I am, giving back to the community what I have gotten from reading this forum, looking at examples, and what not.

Its not a very elaborate script, as you have to manually edit it with relevant info to make full use of it, but it has the potential to keep running for hours on end, verified by watching a few movies away from the computer, coming back and actually having made progress.

Anyway, enough rambling, on with the code:

;*****************************************************************************
;*  This program is free software: you can redistribute it and/or modify   *
;*  it under the terms of the GNU General Public License as published by   *
;*  the Free Software Foundation, either version 3 of the License, or     *
;*  (at your option) any later version.                                 *
;*                                                                         *
;*  This program is distributed in the hope that it will be useful,     *
;*  but WITHOUT ANY WARRANTY; without even the implied warranty of       *
;*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
;*  GNU General Public License for more details.                           *
;*                                                                         *
;*  You should have received a copy of the GNU General Public License     *
;*  along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
;*****************************************************************************

;*****************************************************************************
;* AFK Skill Trainer Bot for 9Dragons                                       *
;* Author: me@dafoe.se                                                     *
;*****************************************************************************
#include <GUIConstants.au3> 


;*****************************************************************************
;* Setup some keybindings for operating the trainer.                         *
;*****************************************************************************
HotKeySet( "{ESC}", "_EXIT"); Shutdown the Script.
HotKeySet( "{F11}", "_START");Start botting, WOHOOO!!!!
HotKeySet( "^{F11}", "_PAUSE");"Pause" the execution, in fact the script keeps running in the loop without actually doing anything
HotKeySet( "{F10}", "_NEXT");Select next skill

;*****************************************************************************
;* Define Constants used with the skill array.                             *
;*****************************************************************************
Global Const $_NAME = 0
Global Const $_KEY = 1
Global Const $_DELAY = 2
Global Const $_VECOST = 3

Global $activeSkill = 0;set the default active skill.
Global $ve = 770; Edit this to set up how much VE your character has, or how much you want to use before meditating.


;*****************************************************************************
;* Define skills.                                                           *
;*****************************************************************************
Global $skill[10][4];Setup an array of 10 skills. That should be enough since you cant have more of them on the bar ingame.

$skill[0][$_NAME] = "Demonic Healing of Blood The Sky" ; This is what will be shown in the toolwindow
$skill[0][$_KEY] = 7                                ; Which key do you have this skill on?
$skill[0][$_DELAY] = 5000                           ; How long should we wait before "pressing" the key again?
$skill[0][$_VECOST] = 12                            ; How much VE does this skill cost?

$skill[1][$_NAME] = "Demonic Spirit of Madness"
$skill[1][$_KEY] = 8
$skill[1][$_DELAY] = 5000
$skill[1][$_VECOST] = 20

Dim $iArraySize = 2;Set the array size, for our next skill function.

Dim $hWnd, $hlSkill, $hlVE;Define our window and control handlers
Dim $pause = 0;Initialize the pause

;*****************************************************************************
;* Setup "easy" cell creation within window controls                         *
;*****************************************************************************
Opt("GUICoordMode",2)

;*****************************************************************************
;* Crude way of making the bot stop its skill mashing. I just couldnt think  *
;* of a better way at the moment.                                           *
;*****************************************************************************
Func _PAUSE()
    $pause = 1 - $pause
    if $pause Then
        GUICtrlSetColor($hlVE, 0xFF0000)
    Else
        GUICtrlSetColor($hlVE, 0x00FF00)
    EndIf
EndFunc

;*****************************************************************************
;* Start botting.                                                           *
;*****************************************************************************
Func _START()
    GUICtrlSetColor($hlVE, 0x00FF00)
    While 1
        $curVE = $ve
        Do; Lets repeat the skillmashing as long as we have VE for it.
            if $pause = 0 Then
                Send($skill[$activeSkill][$_KEY])
                Sleep ($skill[$activeSkill][$_DELAY])
                $curVE -= $skill[$activeSkill][$_VECOST]
                GUICtrlSetData($hlVE, $curVE)
            EndIf
        Until $curVE < $skill[$activeSkill][$_VECOST]
        
    ; Time to meditate.
        Send("{p}")
        Sleep (30000)
    WEnd
EndFunc


;*****************************************************************************
;* Exit the trainer.                                                         *
;*****************************************************************************
Func _EXIT()
    Exit 0
EndFunc

;*****************************************************************************
;* Switch to the next skill in the list                                   *
;*****************************************************************************
Func _NEXT()
    $activeSkill += 1;
    $activeSkill = Mod($activeSkill, $iArraySize)
    GUICtrlSetData($hlSkill, $skill[$activeSkill][$_NAME])
EndFunc

;*****************************************************************************
;* Our Main function, where all the non-data initialization will take place. *
;* Here we create the the toolwindow and fill it with initial data.       *
;*****************************************************************************
Func _MAIN()
    $hWnd = GUICreate("9Dragons Skill Trainer", 250, 30, 750, 15, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
    $hlSkill = GUICtrlCreateLabel($skill[$activeSkill][$_NAME], 10, 10, 200)
    $hlVE = GUICtrlCreateLabel($ve, 0, -1, 30)
    GUISetState()
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc


_MAIN()

Keybinds

* F10 - Cycle through the defined skills, can be done while the mashing is active.

* F11 - Starts the skillmashing.

* Ctrl+F11 - Toggles pause.

* Esc - Shuts down the script completely.

Enjoy, and if you have any suggestions for improvement, feel free to share em :)

Share this post


Link to post
Share on other sites



Hey, nice script. I have a little problem thou...

I run the game in window, lunch the script, start it.. and nothing happens.

When Im in the game window i see the script. it runs.. but, it dosnt "push" the buttons in the game.

When i minimalize the game, i can hear the window sound then you push button (the one you hear when you use button not accured to the situation/program).

Can someone pliz, give me a solution to this problem?

Scritp runs, game runs.. but script dont "push" buttons in game, but in windows.

Share this post


Link to post
Share on other sites

Hey, nice script. I have a little problem thou...

I run the game in window, lunch the script, start it.. and nothing happens.

When Im in the game window i see the script. it runs.. but, it dosnt "push" the buttons in the game.

When i minimalize the game, i can hear the window sound then you push button (the one you hear when you use button not accured to the situation/program).

Can someone pliz, give me a solution to this problem?

Scritp runs, game runs.. but script dont "push" buttons in game, but in windows.

the script have to be compiled and renamed pinnacle.exe in order to work.

Sadly, after talking to some people and read a bit, I have decided to not support the script anymore. It is out here as a source for people to draw upon, but I wont update it.

Share this post


Link to post
Share on other sites

the script have to be compiled and renamed pinnacle.exe in order to work.

Sadly, after talking to some people and read a bit, I have decided to not support the script anymore. It is out here as a source for people to draw upon, but I wont update it.

Its a good little script. I tried to build on it a bit (a bit too much of a 1st solo project...yes I'm like "uber noob" for programming =\ )...created a nice GUI though, and some inputs so u will not have to constantly edit the script for different skills. Similar cosmetically to Dizzy's original Pinnacle. However...make everything work the same way seems to be the troublesome part. I thought about pasting the code...but I am not sure i want to be ridiculed by all of you knowledgable programming guru's!!!!

***To add to the above problem about keys not working in game...not sure what to tell you. It worked well for me. Basic: Did you make sure you're higlighted on urself or something else for buffs...and sometimes it seems as though you have to hit "p" and med right before starting or it will not med properly during loop.

***If anyone would like to offer some assistance (and be prepared for a headache when u see the script...remember i have NO idea what im truly doing...it would be great. Thanks!!!!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Func _MAIN()

$hWnd = GUICreate("9Dragons Skill Trainer", 250, 30, 750, 15, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))

$hlSkill = GUICtrlCreateLabel($skill[$activeSkill][$_NAME], 10, 10, 200)

$hlVE = GUICtrlCreateLabel($ve, 0, -1, 30)

GUISetState()

Do

Until GUIGetMsg() = $GUI_EVENT_CLOSE

EndFunc

seems to have a problem here

im not really good at this so i coouldnt find it

tried to run the script but says Error on this part

$hWnd = GUICreate("9Dragons Skill Trainer", 250, 30, 750, 15, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))

this part

($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))

Edited by Jay4

Share this post


Link to post
Share on other sites

i see that its not complete.

but the basics are there how to auto med ..

mutch to learn tho bulding a gui on it.

fun to do to.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0