Jump to content

.au3 (333) : ==> Incorrect number of parameters in function call.:


 Share

Recommended Posts

Hi everybody !

I'm stucked in this moment. Im trying to make nicely keybinder, but function wont to start. I make just only first function to test it, but it wont start cause

(333) : ==> Incorrect number of parameters in function call.:
MsgBox("sdf", "sdfsdf")
^ ERROR
>Exit code: 1    Time: 16.415

I know that i must add some vars to " Func start1($param, $param etc) but i tested everyting and i still dont know which var is "must be" to start this function...

Any help ?

Whole code:

; Inculdes

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiComboBox.au3>
#include <Misc.au3>
#include <File.au3>
#include <GUIConstantsEx.au3>
#include <Inet.au3>
#include <Array.au3>
#include "IniString.au3"

; Var
Global Const $nazwa = 'Ultimate Keybinder'
Global Const $wersja = ' v 2.0'
Global $delay, $sloop1, $Startloop1
Global $a1, $a2, $a3, $a4, $a5, $a6, $a7, $a8, $a9, $0
Global $Langfile, $Lang
Global $keystart1,$hexkey1,$Enter1,$WP1,$Loop1,$gra,$Input2,$tekst1,$aktiv1

$sSource_Mem_Ini = _InetGetSource("http://raz0r.net46.net/ultimate_keybinder/news/update.dat")  ;; newsy z neta
$ndata = _IniString_Read($sSource_Mem_Ini, "Newsy", "data", "") ;;; news data
$ntresc = _IniString_Read($sSource_Mem_Ini, "Newsy", "index", "") ;;; news tresc
$nurl = _IniString_Read($sSource_Mem_Ini, "Newsy", "url", "") ;;; news url
$ndata2 = _IniString_Read($sSource_Mem_Ini, "Newsy2", "data", "") ;;; news data
$ntresc2 = _IniString_Read($sSource_Mem_Ini, "Newsy2", "index", "") ;;; news tresc


Dim $aLang
$STATE = 0;"UNCHECKED"

Opt("TrayIconHide", 0)
Opt("TrayIconDebug", 1)
Opt("SendKeyDelay", 2)

; GUI
$Lang = IniRead("config.ini", "Language", "Lang", "")
If $Lang = "ENG" Then
    $Langfile = "Lang.ENG"
ElseIf $Lang = "POL" Then
    $Langfile = "Lang.POL"
EndIf

_FileReadToArray ($Langfile, $aLang)

#Region ### START Koda GUI section ### Form=C:\Users\Tomek\Desktop\NaukaAutoIT\MausMe\ultimate keybinder.kxf
$gui = GUICreate($nazwa & " " &$wersja,  843, 433, 529, 271)
GUISetBkColor(0x808080)
$Label1 = GUICtrlCreateLabel("made by RaZ0r", 720, 408, 77, 17)
GUICtrlSetFont(-1, 4, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$Label2 = GUICtrlCreateLabel($aLang[1], 40, 8, 100, 28)
GUICtrlSetFont(-1, 15, 800, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$Label3 = GUICtrlCreateLabel($aLang[4], 72, 40, 46, 17)
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$Button1 = GUICtrlCreateButton($aLang[2], 8, 64, 67, 25)
$Button2 = GUICtrlCreateButton($aLang[3], 104, 64, 67, 25)
$Label4 = GUICtrlCreateLabel("Now loaded", 56, 96, 61, 17)
GUICtrlSetResizing(-1, $GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKVCENTER)
$Label5 = GUICtrlCreateLabel($aLang[5], 9, 130, 52, 17)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT)
$Label6 = GUICtrlCreateLabel($aLang[6], 418, 8, 95, 28)
GUICtrlSetFont(-1, 15, 800, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$Label7 = GUICtrlCreateLabel($aLang[7], 240, 64, 64, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$Label14 = GUICtrlCreateLabel("Delay", 9, 190, 31, 17)
$Label8 = GUICtrlCreateLabel($aLang[8], 398, 64, 64, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$Label9 = GUICtrlCreateLabel("Chat key", 9, 160, 46, 17)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT)
$Label11 = GUICtrlCreateLabel($aLang[10], 613, 64, 71, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$Label10 = GUICtrlCreateLabel($aLang[9], 558, 64, 46, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$Label12 = GUICtrlCreateLabel($aLang[11], 675, 64, 71, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$Label13 = GUICtrlCreateLabel($aLang[12], 768, 64, 71, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKBOTTOM)
$aktiv1 = GUICtrlCreateCheckbox("", 256, 100, 17, 20)
$activ2 = GUICtrlCreateCheckbox("", 256, 130, 17, 20)
$activ3 = GUICtrlCreateCheckbox("", 256, 160, 17, 17)
$activ4 = GUICtrlCreateCheckbox("", 256, 190, 17, 17)
$tekst1 = GUICtrlCreateInput("", 296, 100, 250, 21)
$tekst2 = GUICtrlCreateInput("", 296, 130, 250, 21)
$tekst3 = GUICtrlCreateInput("", 296, 160, 250, 21)
$activ5 = GUICtrlCreateCheckbox("", 256, 220, 17, 17)
$activ7 = GUICtrlCreateCheckbox("", 256, 280, 17, 17)
$activ8 = GUICtrlCreateCheckbox("", 256, 310, 17, 17)
$Activ9 = GUICtrlCreateCheckbox("", 256, 340, 17, 17)
$Activ10 = GUICtrlCreateCheckbox("", 256, 370, 17, 17)
$activ6 = GUICtrlCreateCheckbox("", 256, 250, 17, 17)
$tekst4 = GUICtrlCreateInput("", 296, 190, 250, 21)
$tekst5 = GUICtrlCreateInput("", 296, 220, 250, 21)
$tekst6 = GUICtrlCreateInput("", 296, 250, 250, 21)
$tekst7 = GUICtrlCreateInput("", 296, 280, 250, 21)
$tekst8 = GUICtrlCreateInput("", 296, 310, 250, 21)
$tekst9 = GUICtrlCreateInput("", 296, 340, 250, 21)
$tekst10 = GUICtrlCreateInput("", 296, 370, 250, 21)
$Combo1 = GUICtrlCreateCombo("", 552, 100, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Enter1 = GUICtrlCreateCheckbox("", 642, 100, 17, 17)
$Loop1 = GUICtrlCreateCombo("OFF", 682, 100, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "30s|60s/1min|90s|120s/2min|150s|180s/3min|210s|240s/4min|270s|300s/5min")
$WP1 = GUICtrlCreateCheckbox("", 774, 100, 17, 17)
$Combo2 = GUICtrlCreateCombo("", 552, 130, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Combo3 = GUICtrlCreateCombo("", 552, 160, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Combo4 = GUICtrlCreateCombo("", 552, 190, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Combo5 = GUICtrlCreateCombo("", 552, 220, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Combo6 = GUICtrlCreateCombo("", 552, 250, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Combo7 = GUICtrlCreateCombo("", 552, 280, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Combo8 = GUICtrlCreateCombo("", 552, 310, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Combo9 = GUICtrlCreateCombo("", 552, 340, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Combo10 = GUICtrlCreateCombo("", 552, 370, 74, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Numpad 1|Numpad 2|Numpad 3|Numpad 4|Numpad 5|Numpad 6|Numpad 7|Numpad 8|Numpad 9|Numpad 0")
$Label15 = GUICtrlCreateLabel($aLang[13], 9, 220, 58, 17)
$Enter2 = GUICtrlCreateCheckbox("", 642, 130, 17, 17)
$Enter4 = GUICtrlCreateCheckbox("", 642, 190, 17, 17)
$Enter3 = GUICtrlCreateCheckbox("", 642, 160, 17, 17)
$Enter5 = GUICtrlCreateCheckbox("", 642, 220, 17, 17)
$Enter6 = GUICtrlCreateCheckbox("", 642, 250, 17, 17)
$Enter7 = GUICtrlCreateCheckbox("", 642, 280, 17, 17)
$Enter8 = GUICtrlCreateCheckbox("", 642, 310, 17, 17)
$Enter9 = GUICtrlCreateCheckbox("", 642, 340, 17, 17)
$Enter10 = GUICtrlCreateCheckbox("", 642, 370, 17, 17)
$Loop2 = GUICtrlCreateCombo("OFF", 682, 130, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "30s|60s/1min|90s|120s/2min|150s|180s/3min|210s|240s/4min|270s|300s/5min")
$Loop3 = GUICtrlCreateCombo("", 682, 160, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Loop4 = GUICtrlCreateCombo("", 682, 190, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Loop5 = GUICtrlCreateCombo("", 682, 220, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Loop6 = GUICtrlCreateCombo("", 682, 250, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Loop7 = GUICtrlCreateCombo("", 682, 280, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Loop8 = GUICtrlCreateCombo("", 682, 310, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Loop9 = GUICtrlCreateCombo("", 682, 340, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$Loop10 = GUICtrlCreateCombo("", 682, 370, 58, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
$WP2 = GUICtrlCreateCheckbox("", 774, 130, 17, 17)
$WP3 = GUICtrlCreateCheckbox("", 774, 160, 17, 17)
$WP4 = GUICtrlCreateCheckbox("", 774, 190, 17, 17)
$WP5 = GUICtrlCreateCheckbox("", 774, 220, 17, 17)
$WP6 = GUICtrlCreateCheckbox("", 774, 250, 17, 17)
$WP7 = GUICtrlCreateCheckbox("", 774, 280, 17, 17)
$WP8 = GUICtrlCreateCheckbox("", 774, 310, 17, 17)
$WP9 = GUICtrlCreateCheckbox("", 774, 340, 17, 17)
$WP10 = GUICtrlCreateCheckbox("", 774, 370, 17, 17)
$gra = GUICtrlCreateInput("", 99, 130, 130, 17)
$Input2 = GUICtrlCreateInput("", 199, 160, 30, 17)
$Combo11 = GUICtrlCreateCombo("0,5s", 156, 190, 73, 21, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GuiCtrlSetData(-1, "1s|2s")
$Checkbox1 = GUICtrlCreateCheckbox("", 218, 220, 17, 17)
$newsy = GUICtrlCreateLabel($ndata, 87, 256, 62, 12)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label16 = GUICtrlCreateLabel("NEWS", 87, 232, 53, 17)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$newsINP = GUICtrlCreateInput($nurl, 0, 408, 121, 21, $ES_READONLY)
GUICtrlCreateLabel($ntresc, 0, 272, 250, 49)
$Label17 = GUICtrlCreateLabel($ndata2, 87, 329, 52, 12)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel($ntresc2, 2, 347, 250, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GuiSetState()
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $aktiv1
            sleep(1000)
            GuiCtrlSetState($tekst1, $GUI_DISABLE)
            sleep(1000)
            start1($delay)
            sleep(1000)
    EndSwitch
WEnd

Func test()
        If GUICtrlRead($aktiv1) = $GUI_CHECKED Then
        sleep(10)
    Else
        GUICtrlSetState($aktiv1, $GUI_UNCHECKED)
    EndIf
    EndFunc
;;; WP

Func _WP($wpgmae)  
    $wpgame = GUICtrlRead($game)
    WinActivate ($wpgame, "")
EndFunc

;; Enter

Func _enter()
    Send("{enter}")
EndFunc

;;; Chat key

;;; odczytywanie ile jest w delay

$delay = _GUICtrlComboBoxEx_GetCurSel($Combo11) + 1

If $delay = 1 Then
    $delay = 500
EndIf
If $delay = 2 Then
    $delay = 1000
EndIf
If $delay = 3 Then
    $delay = 1500
EndIf



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; funkcje programu
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; nei ogarnolem dlaczego funkcja nie startuje, cos z spelnianiem zmiennych

Func start1($delay)
;;; pobieranie klawisza
    $keystart1 = _GUICtrlComboBox_GetCurSel($tekst1) + 1
    
    If $keystart1 = 1 Then
        $hexkey1 = 61
    EndIf
    If $keystart1 = 2 Then
        $hexkey1 = 62
    EndIf
    If $keystart1 = 3 Then
        $hexkey1 = 63
    EndIf
    If $keystart1 = 4 Then
        $hexkey1 = 64
    EndIf
    If $keystart1 = 5 Then
        $hexkey1 = 65
    EndIf
    If $keystart1 = 6 Then
        $hexkey1 = 66
    EndIf
    If $keystart1 = 7 Then
        $hexkey1 = 62
    EndIf
    If $keystart1 = 8 Then
        $hexkey1 = 68
    EndIf
    If $keystart1 = 8 Then
        $hexkey1 = 62
    EndIf
    If $keystart1 = 9 Then
        $hexkey1 = 69
    EndIf
    If $keystart1 = 10 Then
        $hexkey1 = 60
    EndIf
    
;;; sprawdzanie czy wybrano uzywanie klawisz chatu
    

    
;;; sprawdzanie czy wybrano uzywanie entera

    If $Enter1 = $GUI_CHECKED Then
        $Enter1 = 1
    EndIf
    
;;; sprawdzanie czy wybrano uzywanie WP

    If $WP1 = $GUI_CHECKED Then
        $WP1 = 1
    EndIf
;;; sprawdzanie loopa

    $sloop1 = _GUICtrlComboBox_GetCurSel($Loop1) + 1
    
    If $sloop1 = 2 Then
        $Startloop1 = 3000
    EndIf
    If $sloop1 = 3 Then
        $Startloop1 = 6000
    EndIf
    If $sloop1 = 4 Then
        $Startloop1 = 9000
    EndIf
    If $sloop1 = 5 Then
        $Startloop1 = 12000
    EndIf
    If $sloop1 = 6 Then
        $Startloop1 = 15000
    EndIf
    If $sloop1 = 7 Then
        $Startloop1 = 18000
    EndIf
    If $sloop1 = 8 Then
        $Startloop1 = 21000
    EndIf
    If $sloop1 = 9 Then
        $Startloop1 = 24000
    EndIf
    If $sloop1 = 10 Then
        $Startloop1 = 27000
    EndIf
    If $sloop1 = 11 Then
        $Startloop1 = 30000
    EndIf
        
;;;;;;;;;;;;;;;;;;;
;;; start key1
;;;;;;;;;;;;;;;;;;;
_FileReadToArray ($Langfile, $aLang)
        If GUICtrlRead($aktiv1, 0) = $GUI_CHECKED Then
            If $sloop1 > 1 Then
                MsgBox("sdf", "sdfsdf")
                sleep($delay)
                Do
                _WP()
                sleep($delay)
                If WinActive($gra) Then
                        BlockInput(1)
                        Send($Input2)
                        Send($tekst1)
                        sleep($delay)
                        _enter()
                        EndIf
                    Until GUICtrlRead($aktiv1) = $GUI_UNCHECKED
                    EndIf
                    
                        

        ElseIf GUICtrlRead($aktiv1) = $GUI_UNCHECKED Then
            GuiCtrlSetState($tekst1, $GUI_ENABLE)

                sleep(10)
            EndIf
EndFunc

PS I set sleep(1000) cause i want to see what debug show

Edited by RaZ0r
Link to comment
Share on other sites

Parameter 1 has to be numeric.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Not to be picky but this word rings alarm bells around here

$game

If its game related i would read the rules just to check

also have a look at switch in the helpfile

this maybe an easier way, just a rough eg you will need to check first

Switch
    Case $sloop1 = 2
        $Startloop1 = 3000
    Case $sloop1 = 3
        $Startloop1 = 6000
    Case $sloop1 = 4
        $Startloop1 = 9000
    Case $sloop1 = 5
        $Startloop1 = 12000
    Case $sloop1 = 6
        $Startloop1 = 15000
    Case $sloop1 = 7
        $Startloop1 = 18000
    Case $sloop1 = 8
        $Startloop1 = 21000
    Case $sloop1 = 9
        $Startloop1 = 24000
    Case $sloop1 = 10
        $Startloop1 = 27000
    Case $sloop1 = 11
        $Startloop1 = 30000
EndSwitch
Edited by Chimaera
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...