Jump to content

Send + IniRead help...


Recommended Posts

Ok so... In my script i have:

Send($SwitchTG)oÝ÷ Ø Ý¯y«­¢+Ù±½°ÀÌØíMݥѡQô%¹¥I¡MÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈí½¹¥¹¥¹¤ÅÕ½Ðì°ÅÕ½ÐíMÑÑ¥¹ÌÅÕ½Ðì°ÅÕ½ÐíMݥѡQÅÕ½Ðì°ÅÕ½ÐìÈÅÕ½Ðì¤

In my ini file i have:

[Settings]

SwitchTG = "2"

How can i make it so it actually sends the Number 2 out? not numpad2

I want to be able to change it regually and quickly so its got to be from the ini file...

Does anyone know

Edited by XxXGoD
Link to comment
Share on other sites

I read the help it sitll doesnt work.

HI,

this?

Send('{NUMPAD' & $SwitchTG& '}')

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

It actually sends the number 2 out. It does not presses the NUM-2 button. To verify this, try to turn off your NumLock button and run your script to send a number to Notepad for example.

The problem you probably have is not related to AutoIT. Try to tell us in which program you send that number. Some programs handle the keystrocks abnormally.

Link to comment
Share on other sites

Well, i test in notepad its not working...

It HAS To press the 2 on top left of keyboard as im useing the numpad 2 as the button what sends s series of keys, what includes the number 2

Edited by XxXGoD
Link to comment
Share on other sites

Hmm ... maybe I'm wrong but ... I guess the content of your ini file could generate the problem

[Settings]

SwitchTG = "2"oÝ÷ Ø;^*.­æ¶¯j[jË(r&­yÛhK­rÆ~涢'âëaÌ(ºW[z«¨·j®¢Ö§vz-¶§ºfÞ¯k(¶¢{^ÛÜ"VÞªê-Ú«¨¶)ìµæ¡ö¬je{cÉ·²¢çÈZ­ç(קµ«ºÚ"µÍÔÙ][Ü×BÝÚ]ÚÈH

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Well here is my script:

Still doesnt send 2 when pressed...

#cs ----------------------------------------------------------------------------
    
    AutoIt Version: 3.2.2.0
    Author:         Ryan D
    
    Script Function:
    Will Butterfly
    
#ce ----------------------------------------------------------------------------

;; Global Pause Start
Global $Paused
;; Global Pause End

;; Global Pause for Butterfly Start
Global $UpBFMove_Used = False
Global $DownBFMove_Used = False
Global $LeftBFMove_Used = False
Global $RightBFMove_Used = False
;; Global Pause for Butterfly End


;; Global Pause for SlashShot Start
Global $UpSSMove_Used = False
Global $DownSSMove_Used = False
Global $LeftSSMove_Used = False
Global $RightSSMove_Used = False
;; Global Pause for SlashShot End


;; Ini Read for Movement keys Start
Global $UpBFMove = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Up", "W")
Global $DownBFMove = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Down", "S")
Global $LeftBFMove = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Left", "A")
Global $RightBFMove = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Right", "D")
;; Ini Read for Movement keys End


;; Ini Read for Butterfly Start Function Keys Start
Global $UpBFMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Up Start", "{UP}")
Global $DownBFMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Down Start", "{DOWN}")
Global $LeftBFMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Left Start", "{LEFT}")
Global $RightBFMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys BF", "Butterfly Move Right Start", "{RIGHT}")
;; Ini Read for Butterfly Start Function Keys End


;; Ini Read for Movement keys Start
Global $UpSSMove = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Up", "W")
Global $DownSSMove = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Down", "S")
Global $LeftSSMove = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Left", "A")
Global $RightSSMove = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Right", "D")
;; Ini Read for Movement keys End


;; Ini Read for SlashShot Start Function Keys Start
Global $UpSSMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Up Start", "{NUMPAD8}")
Global $DownSSMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Down Start", "{NUMPAD2}")
Global $LeftSSMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Left Start", "{NUMPAD4}")
Global $RightSSMoveSF = IniRead(@ScriptDir & "\config.ini", "HotKeys SS", "SlashShot Move Right Start", "{NUMPAD6}")
;; Ini Read for SlashShot Start Function Keys End


;; Ini Read for Extra Settings Start
Global $EnableBF = IniRead(@ScriptDir & "\config.ini", "Settings", "Enable Butterfly", "Yes")
Global $SSSwitchToGun = IniRead(@ScriptDir & "\config.ini", "Settings", "Switch To Gun", "2")
Global $SSSwitchToGunRelease = IniRead(@ScriptDir & "\config.ini", "Settings", "Switch To Gun Release", "2")
Global $EnableSS = IniRead(@ScriptDir & "\config.ini", "Settings", "Enable SlashShot", "Yes")
Global $MinDelay = IniRead(@ScriptDir & "\config.ini", "Delays", "Min Delay", "10")
Global $MaxDelay = IniRead(@ScriptDir & "\config.ini", "Delays", "Max Delay", "20")
;; Ini Read for Extra Settings End


;; Misc HotKeys Start
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
;; Misc HotKeys End


;; ButterFly HotKeys Start
HotKeySet($UpBFMoveSF, "UpBFMove")
HotKeySet($DownBFMoveSF, "DownBFMove")
HotKeySet($LeftBFMoveSF, "LeftBFMove")
HotKeySet($RightBFMoveSF, "RightBFMove")
;; ButterFly HotKeys End


;; Slash Shot HotKeys Start
HotKeySet($UpSSMoveSF, "UpSSMove")
HotKeySet($DownSSMoveSF, "DownSSMove")
HotKeySet($LeftSSMoveSF, "LeftSSMove")
HotKeySet($RightSSMoveSF, "RightSSMove")
;; Slash Shot HotKeys End



;; Global Sleep Start
While 1
    Sleep(10)
WEnd
;; Global Sleep End


;; TogglePause Start
Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc
;; TogglePause End


;; Terminate/Exit Start
Func Terminate()
    MsgBox(0x0, "", "... Exiting", 1)
    Exit 0
EndFunc
;; Terminate/Exit End




;; Upwards Butterfly Move Start
Func UpBFMove()
    If $UpBFMove_Used Then Return
    If $EnableBF = "Yes" Then
        Sleep(Random($MinDelay, $MaxDelay, 1))
        Send("{SPACE}")
        Send($UpBFMove)
        Send($UpBFMove)
        MouseClick("left")
        Sleep(Random(200, 210, 1))
        Send("{LSHIFT}")
        $UpBFMove_Used = False
    EndIf
EndFunc
;; Upwards Butterfly Move End


;; Left Butterfly Move Start
Func LeftBFMove()
    If $LeftBFMove_Used Then Return
    If $EnableBF = "Yes" Then
        Sleep(Random($MinDelay, $MaxDelay, 1))
        Send("{SPACE}")
        Send($LeftBFMove)
        Send($LeftBFMove)
        MouseClick("left")
        Sleep(Random(200, 210, 1))
        Send("{LSHIFT}")
        $LeftBFMove_Used = False
    EndIf
EndFunc 
;; Left Butterfly Move End


;; Down Butterfly Move Start
Func DownBFMove()
    If $DownBFMove_Used Then Return
    If $EnableBF = "Yes" Then
        Sleep(Random($MinDelay, $MaxDelay, 1))
        Send("{SPACE}")
        Send($DownBFMove)
        Send($DownBFMove)
        MouseClick("left")
        Sleep(Random(200, 210, 1))
        Send("{LSHIFT}")
        $DownBFMove_Used = False
    EndIf
EndFunc
;; Down Butterfly Move End


;; Right Butterfly Move Start
Func RightBFMove()
    If $RightBFMove_Used Then Return
    If $EnableBF = "Yes" Then
        Sleep(Random($MinDelay, $MaxDelay, 1))
        Send("{SPACE}")
        Send($RightBFMove)
        Send($RightBFMove)
        MouseClick("left")
        Sleep(Random(200, 210, 1))
        Send("{LSHIFT}")
        $RightBFMove_Used = False
    EndIf
EndFunc 
;; Right Butterfly Move End










;; Upwards SlashShot Move Start
Func UpSSMove()
    If $UpSSMove_Used Then Return
    If $EnableSS = "Yes" Then
        Sleep(Random($MinDelay, $MaxDelay, 1))
        Send("{SPACE}")
        Send($UpSSMove)
        Send($UpSSMove)
        MouseDown("left")
        Send($SSSwitchToGun)
        Send($SSSwitchToGunRelease)
        MouseUp("left")
        $UpSSMove_Used = False
    EndIf
EndFunc
;; Upwards SlashShot Move End


;; Left SlashShot Move Start
Func LeftSSMove()
    If $LeftSSMove_Used Then Return
    If $EnableSS = "Yes" Then
        Sleep(Random($MinDelay, $MaxDelay, 1))
        Send("{SPACE}")
        Send($LeftSSMove)
        Send($LeftSSMove)
        MouseDown("left")
        Send($SSSwitchToGun)
        Send($SSSwitchToGunRelease)
        MouseUp("left")
        $LeftSSMove_Used = False
    EndIf
EndFunc
;; Left SlashShot Move End


;; Down SlashShot Move Start
Func DownSSMove()
    If $DownSSMove_Used Then Return
    If $EnableSS = "Yes" Then
        Sleep(Random($MinDelay, $MaxDelay, 1))
        Send("{SPACE}")
        Send($DownSSMove)
        Send($DownSSMove)
        MouseDown("left")
        Send($SSSwitchToGun)
        Send($SSSwitchToGunRelease)
        MouseUp("left")
        $DownSSMove_Used = False
    EndIf
EndFunc
;; Down SlashShot Move End


;; Right SlashShot Move Start
Func RightSSMove()
    If $RightSSMove_Used Then Return
    If $EnableSS = "Yes" Then
        Sleep(Random($MinDelay, $MaxDelay, 1))
        Send("{SPACE}")
        Send($RightSSMove)
        Send($RightSSMove)
        MouseDown("left")
        Send($SSSwitchToGun)
        Send($SSSwitchToGunRelease)
        MouseUp("left")
        $RightSSMove_Used = False
    EndIf
EndFunc
;; Right SlashShot Move End

Here is my ini file:

[HotKeys BF]
;====================================================================================
;
;                    HotKeys
;
; * Butterfly Move Up => The button you use to move upwards
;
; * Butterfly Move Down => The button you use to move downwards
;
; * Butterfly Move Left => The button you use to move left
;
; * Butterfly Move Right => The button you use to move right
;
;
; * Butterfly Move Up Start => The button you use to Butterfly upwards
;
; * Butterfly Move Down Start => The button you use to Butterfly downwards
;
; * Butterfly Move Left Start => The button you use to Butterfly left
;
; * Butterfly Move Right Start => The button you use to Butterfly right
;
;====================================================================================

Butterfly Move Up = W
Butterfly Move Down = S
Butterfly Move Left = A
Butterfly Move Right = D


Butterfly Move Up Start = "{UP}"
Butterfly Move Down Start = "{DOWN}"
Butterfly Move Left Start = "{LEFT}"
Butterfly Move Right Start = "{RIGHT}"
;====================================================================================




[HotKeys SS]
;====================================================================================
;
;                    HotKeys
;
; * SlashShot Move Up => The button you use to move upwards
;
; * SlashShot Move Down => The button you use to move downwards
;
; * SlashShot Move Left => The button you use to move left
;
; * SlashShot Move Right => The button you use to move right
;
;
; * SlashShot Move Up Start => The button you use to SlashShot upwards
;
; * SlashShot Move Down Start => The button you use to SlashShot downwards
;
; * SlashShot Move Left Start => The button you use to SlashShot left
;
; * SlashShot Move Right Start => The button you use to SlashShot right
;
; * Switch To Gun => Key you use to switch to your gun, use 0-9 dont know if Letters
;            work
;
;====================================================================================

SlashShot Move Up = W
SlashShot Move Down = S
SlashShot Move Left = A
SlashShot Move Right = D


SlashShot Move Up Start = "{NUMPAD8}"
SlashShot Move Down Start = "{NUMPAD2}"
SlashShot Move Left Start = "{NUMPAD4}"
SlashShot Move Right Start = "{NUMPAD6}"

Switch To Gun = "2 DOWN"
Switch To Gun Release = "2 UP"
;====================================================================================





[Settings]
;====================================================================================
;
;                    Settings
;
; * Enable Butterfly => 
;
; * Enable SlashShot => 
;
;====================================================================================

Enable Butterfly = Yes
Enable SlashShot = Yes

;====================================================================================








[Delays]
;====================================================================================
;
;                                 Delays
;
;           IF YOU DONT KNOW WHAT THIS IS STAY OUT
;
; * Min Delay => Mimimum Delay Between Each Action on the script.
;
; * Max Delay => Maximum Delay Between Each Action on the script.
;
;
;       Note: Delay is in Miliseconds, so 1000 = 1 Second
;
;====================================================================================

Min Delay = 10
Max Delay = 20
Link to comment
Share on other sites

There is something strange ...

You said you want to send "2" (SwitchToGun value) but your ini file content shows:

Switch To Gun = "2 DOWN"

Switch To Gun Release = "2 UP"

IMHO the value read fron this ini key will be 2 DOWN which is considered as a string and not a number as you want.

If you want to send the number 2 then tyou should change the ini value: Switch To Gun = 2 or Switch To Gun = "2"

I don't know what could be the meaning of DOWN and UP? Are you trying to send arrow keys? Are you trying to use something like "_IsPressed" function?

I'm really confused. :)

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

There is something strange ...

You said you want to send "2" (SwitchToGun value) but your ini file content shows:

IMHO the value read fron this ini key will be 2 DOWN which is considered as a string and not a number as you want.

If you want to send the number 2 then tyou should change the ini value: Switch To Gun = 2 or Switch To Gun = "2"

I don't know what could be the meaning of DOWN and UP? Are you trying to send arrow keys? Are you trying to use something like "_IsPressed" function?

I'm really confused. :)

Lol

If you use: Send("{ENTER DOWN}") then it will hold it down.

I tryed that method to see if it was something i was doing wrong, it should be just: Send($SwitchTG) and in the ini file it to be: Switch To Gun = "2"

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...