Jump to content

Some Help With X,y Coords :(


Recommended Posts

Hey its me again, this time i have harder problem (i think anyways :mellow:) Alright the macro im making for my game is coming along with noob programming, but i looked on this site and saw something mazing for the same game. This guy had program (made in AutoIt becuz he told me but didnt tell me how :)) and for the hotkeys and stuff all you had to do is hit CTRL+D and it would give you the corods on the screen -.-. If anyone could help me but have the hotkey CTRL+G and the coord coding. I have an idea how to dit, would the GetPos have anything to do with it? just trying to throw ideas, maybe some expert can come in ehre and help me out :o Thx again guys :)

Link to comment
Share on other sites

HotKeySet("^g", "_GetPos")
While 1
Sleep(10000)
WEnd
Func _GetPos()
local $pos = MouseGetPos()
MsgBox(0,'',$pos[0] & "<---X Coord  | Y Coord --->" & $pos[1])
EndFunc

That 'ought to do it

~cdkid

Edited by cdkid
AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

It might just be me but that script doesn't work.

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]

Link to comment
Share on other sites

Oops, had to make the G in my hotkeyset line small :) sorry, all fixed now.

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

Hey thx man, but how do i add it into a checbox coding? Dont i just take out the EndFunc, or will it work anyways? Wow thx man, theres alot of smart people on autoit :) At least i was right about GetPos :)

EDIT: Uhh it gives error: FuncGetPos has no matching EndFunc :mellow:

Edited by UnknownWarrior
Link to comment
Share on other sites

Here, I just made a change to Cdkids code so it's a tooltip instead. So it doesn't get in the way

HotKeySet("^g", "_GetPos")
While 1
Sleep(10000)
WEnd
Func _GetPos()
local $pos = MouseGetPos()
ToolTip(($pos[0] & "<---X Coord  | Y Coord --->" & $pos[1]), 0, 0)
EndFunc

Always room for improvment.

(So improve on this NOW)

Edited by Infinitex0

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]

Link to comment
Share on other sites

If BitAND(GUICtrlRead($Checkbox_6), $GUI_CHECKED) = $GUI_CHECKED Then

While 1

Sleep(10000)

WEnd

Func _GetPos()

local $pos = MouseGetPos()

MsgBox(0,'',$pos[0] & "<---X Coord | Y Coord --->" & $pos[1])

EndFunc

Thats my coding, for the if bitand check bo thing... Still gives error: FuncGetPos() has no ending Enbdfunc

I added like Endfunc twice, and added EndFunc ;--->FuncGetPos

I cant seem to figure it out, any help anyone? thx

Edited by UnknownWarrior
Link to comment
Share on other sites

  • Moderators

If BitAND(GUICtrlRead($Checkbox_6), $GUI_CHECKED) = $GUI_CHECKED Then

While 1

Sleep(10000)

WEnd

Func _GetPos()

local $pos = MouseGetPos()

MsgBox(0,'',$pos[0] & "<---X Coord | Y Coord --->" & $pos[1])

EndFunc

Thats my coding, for the if bitand check bo thing... Still gives error: FuncGetPos() has no ending Enbdfunc

I added like Endfunc twice, and added EndFunc ;--->FuncGetPos

I cant seem to figure it out, any help anyone? thx

You don't have a FuncGetPos(), find that in your script and change it to _GetPos()

Edit:

Either that, or show your actual script.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You don't have a FuncGetPos(), find that in your script and change it to _GetPos()

Edit:

Either that, or show your actual script.

Just tried _GetPos() it dont work, says its unknown error, which means its not a true coding... Im not sure what to do, been trying lots of stuff now and cant figure it out :)

Well i got all of it to work i think but 1 thing, it says Func_GetPos() has no ending Endfunc, i copied and pasted the code up at top of thread and also tried putting EndFunc ;==>_GetPos()

no success -.-

Edited by UnknownWarrior
Link to comment
Share on other sites

  • Moderators

This is a guess, because... NO ONE can know what your doing with the little bit that you've posted.

Going off what you posted your code was, it doesn't look like an EndFunc issue, it looks like an EndIf issue.

If BitAND(GUICtrlRead($Checkbox_6), $GUI_CHECKED) = $GUI_CHECKED Then
    _GetPos()
    While 1
     Sleep(10000)
    WEnd
EndIf

Func _GetPos()
    local $pos = MouseGetPos()
    MsgBox(0,'',$pos[0] & "<---X Coord | Y Coord --->" & $pos[1])
EndFunc
If this does not work, then I personally won't even bother to help unless you post your code... I promise you, as sacred as your making it out to be by not posting it, it's probably nothing we haven't seen/written before.

Good Luck.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Do you mean something like this?

#include <GUIConstants.au3>

GUICreate("My GUI") ; will create a dialog box that when displayed is centered
$check = GUICtrlCreateCheckbox("Click here for screen position",20,20,200,25)
$button = GUICtrlCreateButton("GO!",20,80,100,50)
GUISetState (@SW_SHOW)    ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        
    If $msg = $button Then 
    ;MsgBox(1,"alert",GUICtrlRead($check,0))
        If GUICtrlRead($check,0) = 1 Then
            _GetPos()
        Else
            MsgBox(1,"Alert","Not checked")
        EndIf
    EndIf   
    
Wend


Func _GetPos()
    local $pos = MouseGetPos()
    MsgBox(0,'',$pos[0] & "<---X Coord | Y Coord --->" & $pos[1])
EndFunc

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

Grrr but its on a game, and if anyone here is part of game they might tattle on me -.-

edit: nope that code dont work, same error, Func_GetPos() has no matching EndFunc

That's because it's not "Func_GetPos()".

The line is "Func _GetPos()". There is a space after "Func".

What is going on is this: Func is the command to create a new function. After Func is the name of the function. For each Func, there must be an EndFunc.

So, if I wanted to create a function called "myFunction" it would look like this:

Func myFunction()

; Code in here

EndFunc

That is all you need. If you have too many EndFunc or if you are missing one (your problem), then you will get that error.

Frankly, no one here probably cares much about your game, and if they did, hopefully your forum name isn't related to your character names in the game.

Post the code and help us help you. :)

Link to comment
Share on other sites

  • Moderators

No... he had embedded functions within functions and too many endfunc's to boot.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

I sent you the corrected code that doesn't throw errors, right after I told you that the code didn't make much sense, but I'm not much intrestead in writing a macro program for an online game, sorry.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

So can u reply to my msg then smoke? u havent yet

I sent you an entire program to do what we think you asked for. Why no reply to my message?
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
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...