Jump to content

Few easy questions I don't know!


Recommended Posts

So I started a new project to work on, it is very simple and I have a few small questions to ask.

Here is the script so far:

#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.0.0

Author:Dazzled myName

Script Function: Makes prospecting, Jewelcrafting, and several other commands easy!

Template AutoIt script.

#ce ----------------------------------------------------------------------------

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#include <ImageListConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Users\Kevin\Desktop\Jewel Crafter\JewelCrafter.kxf

$Main = GUICreate("Jewel Crafter", 358, 287, -1, -1)

GUISetIcon("C:\Users\Kevin\Desktop\Jewel Crafter\Icons\JC.ico")

GUISetBkColor(0x000000)

$Pic1 = GUICtrlCreatePic("C:\Users\Kevin\Desktop\Jewel Crafter\Icons\Jewel Crafter.jpg", 97, 2, 162, 34, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

$Label1 = GUICtrlCreateLabel("v1.0", 8, 0, 37, 34)

GUICtrlSetFont(-1, 14, 400, 0, "Papyrus")

GUICtrlSetColor(-1, 0x0000FF)

$Label2 = GUICtrlCreateLabel("Dazzled", 272, 255, 68, 31)

GUICtrlSetFont(-1, 14, 400, 0, "Pristina")

GUICtrlSetColor(-1, 0x00FF00)

$Saronite = GUICtrlCreateButton("Saronite", 80, 65, 41, 41, BitOR($BS_ICON,$WS_GROUP))

GUICtrlSetImage(-1, "C:\Users\Kevin\Desktop\Jewel Crafter\Icons\Saronite.ico", -1)

GUICtrlSetCursor (-1, 0)

$Label3 = GUICtrlCreateLabel("Saronite", 81, 105, 43, 17)

GUICtrlSetColor(-1, 0xFFFFFF)

$Label4 = GUICtrlCreateLabel("Prospecting", 57, 36, 94, 28)

GUICtrlSetFont(-1, 14, 400, 2, "Harlow Solid Italic")

GUICtrlSetColor(-1, 0x00FF00)

$Earth = GUICtrlCreateButton("Earth", 80, 177, 41, 41, BitOR($BS_ICON,$WS_GROUP))

GUICtrlSetImage(-1, "C:\Users\Kevin\Desktop\Jewel Crafter\Icons\Eternal Earth.ico", -1)

GUICtrlSetCursor (-1, 0)

$Label5 = GUICtrlCreateLabel("Earth", 86, 221, 29, 17)

GUICtrlSetColor(-1, 0xFFFFFF)

$Label6 = GUICtrlCreateLabel(" Eternal Converter", 30, 148, 148, 28)

GUICtrlSetFont(-1, 14, 400, 2, "Harlow Solid Italic")

GUICtrlSetColor(-1, 0x00FF00)

$Label7 = GUICtrlCreateLabel(" Disenchant", 191, 36, 97, 28)

GUICtrlSetFont(-1, 14, 400, 2, "Harlow Solid Italic")

GUICtrlSetColor(-1, 0x00FF00)

$Disenchant = GUICtrlCreateButton("Disenchant", 223, 65, 41, 41, BitOR($BS_ICON,$WS_GROUP))

GUICtrlSetImage(-1, "C:\Users\Kevin\Desktop\Jewel Crafter\Icons\Disenchant.ico", -1)

GUICtrlSetCursor (-1, 0)

$Label8 = GUICtrlCreateLabel("Disenchanter", 211, 105, 67, 17)

GUICtrlSetColor(-1, 0xFFFFFF)

$Label9 = GUICtrlCreateLabel(" Crafter", 207, 148, 65, 28)

GUICtrlSetFont(-1, 14, 400, 2, "Harlow Solid Italic")

GUICtrlSetColor(-1, 0x00FF00)

$Crafter = GUICtrlCreateButton("Crafter", 221, 177, 41, 41, BitOR($BS_ICON,$WS_GROUP))

GUICtrlSetImage(-1, "C:\Users\Kevin\Desktop\Jewel Crafter\Icons\Jewelcrafting.ico", -1)

GUICtrlSetCursor (-1, 0)

GUICtrlCreateInput("10", 220, 232, 45, 21)

GUICtrlSetCursor (-1, 5)

$Label10 = GUICtrlCreateLabel("How many?", 213, 217, 60, 17)

GUICtrlSetColor(-1, 0xFFFFFF)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

WinActivate("World of Warcraft.exe")

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Saronite

Send("{ENTER}")

EndSwitch

WEnd

Basically what I am trying to do is find out how to tell a program to do something, to explain this better here is what I want. In the game World of Warcraft, you click commands which than tell the game to execute that certain thing, for example when I click on the icon "Engineering" the game brings up my Engineering window, I want the 4 buttons I have to execute what they are supposed to rather than me having to make a macro in game, than tell the button to hit the macro (that defeats the purpose of this)

example: I click button 1 labeled "Saronite" and I want World of Warcraft to hit "prospect" and than click on the "Saronite Ore"

How can I do this?

Now as well in the game, you can "create" items using a profession called "Jewelcrafting", this is where you take materials and make them into items such as armor. So...

How do I tie my input box to the button? So when I hit the button it creates X(amount in input box) amount of the items.

example: I insert the number 2 in the input box, I than hit the button above it labeled "Crafter" and I makes 2 of the items.

If you could help me with this I would really really appreciate it this.

Also I am not sure if this helps you at all but if you make the crafter button I made into a macro in game, the macro reads:

/run CloseTradeSkill()

/cast Jewelcrafting

/run local s for i=1,GetNumTradeSkills() do s=GetTradeSkillInfo(i) if (s=="Bloodstone Band") then DoTradeSkill(i,10) end end

/run CloseTradeSkill()

/cast Jewelcrafting

/run local s for i=1,GetNumTradeSkills() do s=GetTradeSkillInfo(i) if (s=="Crystal Chalcedony Amulet") then DoTradeSkill(i,10) end end

/run CloseTradeSkill()

/cast Jewelcrafting

/run local s for i=1,GetNumTradeSkills() do s=GetTradeSkillInfo(i) if (s=="Crystal Citrine Necklace") then DoTradeSkill(i,10) end end

/run CloseTradeSkill()

/cast Jewelcrafting

/run local s for i=1,GetNumTradeSkills() do s=GetTradeSkillInfo(i) if (s=="Sun Rock Ring") then DoTradeSkill(i,10) end end

I want it to execute this in game but the number "10" you are seeing towards the end of each line in parenthesis, is the number in the input box(like 2 in my example)

Link to comment
Share on other sites

So you want a bot to play a computer game for you ?

You will have to define an area of the screen in which to perform a pixelsearch for an already defined colour that you will have had to have defined earlier, then from the array your pixelsearch returns, get the coordinate of said colour and use mousemove and mouseclick to click with whatever button you want at the returned coordinates.

Basically you need to look at

Pixelsearch

Mousemove

Mouseclick

In the helpfile to get you going

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

So you want a bot to play a computer game for you ?

You will have to define an area of the screen in which to perform a pixelsearch for an already defined colour that you will have had to have defined earlier, then from the array your pixelsearch returns, get the coordinate of said colour and use mousemove and mouseclick to click with whatever button you want at the returned coordinates.

Basically you need to look at

Pixelsearch

Mousemove

Mouseclick

In the helpfile to get you going

Ok I am not seeing how to delete this post, it somehow made 2 topics, there is one underneath this topic that is what it is supposed to be, I can't edit my own topic therefore I cant delete...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...