Sign in to follow this  
Followers 0
Sercankd

Form problems

5 posts in this topic

#1 ·  Posted (edited)

i am totaly new in autoit

i want make a simple program for my server but i have some problems and questions

1)$tplist is a combobox that contains teleport lists when i select one and press "Git" it should read a txt file and select the right teleport id i cant get it work i did used search (same with $bosslist too)

2)Problems with buttons and textboxs

example textbox1 contains username and Ban button should read textbox1 but it does not

writes nothing to username like "/ban " it should be "/ban username"

3) buttons writes something 3x or 4x times i want it make only 1x

i know i asked too much but thanks in anyway

my code isnt completed yet but here

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <File.au3>
#include <Array.au3>
HotKeySet("{END}", "Hide")
HotKeySet("{HOME}", "Show")
HotKeySet("{ESC}", "Cikis")
Opt("TrayIconHide", 1)
Global $title = "GM Özel"
Dim $tpliste
_FileReadToArray ( "asd.txt", $tpliste )
$i = 1
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\user\Desktop\Yeni Klasör (3)\Form1.kxf
$Form1 = GUICreate("Form1", 291, 522, 193, 125)
$Group1 = GUICtrlCreateGroup("By Sercankd", 0, 0, 289, 505)
$invisible = GUICtrlCreateButton("Görünmezlik Aç/Kapa", 8, 16, 113, 17, 0)
$banuser = GUICtrlCreateButton("Kullanıcı Banla", 8, 40, 113, 17, 0)
$kullanici = GUICtrlCreateInput("kullanici", 8, 56, 113, 21)
$randomboss = GUICtrlCreateButton("Rastgele Boss", 8, 80, 113, 17, 0)
$npcteleport = GUICtrlCreateButton("NPC Teleport", 8, 104, 113, 17, 0)
$npcid = GUICtrlCreateInput("", 8, 120, 113, 21)
$muteban = GUICtrlCreateButton("Mute Ban", 8, 144, 113, 17, 0)
$kullanicii = GUICtrlCreateInput("", 8, 160, 113, 21)
$Group2 = GUICtrlCreateGroup("Savaş Başlat", 8, 184, 113, 65)
$lunar = GUICtrlCreateButton("Lunar War", 16, 200, 97, 17, 0)
$darklunar = GUICtrlCreateButton("Dark Lunar War", 16, 224, 97, 17, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup("Teleport Ol", 8, 248, 113, 65)
$tplist = GUICtrlCreateCombo (StringReplace($tpliste[1], @CR, ""), 16, 264, 97, 25); create first item
Do
    $tpliste[$i] = StringReplace($tpliste[$i], @CR, "")
    GUICtrlSetData(-1, $tpliste[$i]); add new items that were read from file
   $i = $i + 1
Until $i = $tpliste[0] + 1
$tele = GUICtrlRead($tplist)
GUISetState()
$teleport = GUICtrlCreateButton("Git", 16, 288, 97, 17, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("Havayı Değiştir", 8, 312, 113, 89)
$snowweather = GUICtrlCreateButton("Karlı", 16, 328, 97, 17, 0)
$rainweather = GUICtrlCreateButton("Yağmurlu", 16, 352, 97, 17, 0)
$cleanweather = GUICtrlCreateButton("Havayı Temizle", 16, 376, 97, 17, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group6 = GUICtrlCreateGroup("Notice Kullan", 8, 408, 273, 65)
$notice = GUICtrlCreateInput("", 16, 424, 257, 21)
$pw = GUICtrlRead($notice)
$noticesend = GUICtrlCreateButton("Gönder", 16, 448, 97, 17, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$showonline = GUICtrlCreateButton("Online Sayısını Göster", 120, 448, 145, 17, 0)
$Group7 = GUICtrlCreateGroup("Boss Listesi", 128, 8, 153, 313)
$bosslist = GUICtrlCreateList("", 136, 24, 137, 253)
$read = FileRead("File.ini")
$line = FileReadLine($read)
GUICtrlSetData($bosslist, $line)
$summonboss = GUICtrlCreateButton("Seçili Bossu Çıkar", 136, 280, 137, 17, 0)
$Checkbox1 = GUICtrlCreateCheckbox("Monsummonall kullan", 136, 296, 137, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$hideprog = GUICtrlCreateButton("Programı Gizle", 128, 480, 153, 17, 0)
$Group8 = GUICtrlCreateGroup("Oyuncu DC Ettir", 128, 320, 153, 65)
$kullanic = GUICtrlCreateInput("", 136, 336, 137, 21)
$dcuser = GUICtrlCreateButton("Dc Ettir", 136, 360, 137, 17, 0)
$dcet = GUICtrlRead($dcuser)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel("Program Sercankd tarafından yazılmıştır", 56, 504, 188, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hideprog;
            WinSetState("" & $title, "", @SW_HIDE)
            WinSetOnTop("" & $title, "", 0)
        Case $snowweather;
            Send("/snow 100 {Enter}")
        Case $rainweather;
            Send("/rain 100 {Enter}")
        Case $cleanweather;
            Send("/clean {Enter}")
        Case $showonline;
            Send("/count {Enter}")
        Case $randomboss;
            Send("{+}unikmonster {Enter}")
        Case $lunar;
            ControlSend("Knight Online Client","{+}open2 {Enter}","","")
        Case $darklunar;
            Send("{+}open {Enter}")
        Case $noticesend;
            Send("/notice " & $pw & "{enter}")
        Case $dcuser;
            ControlSend("Knight Online Client","/forbidconnect " & $dcet & "{enter}","","")
    EndSwitch
WEnd
$hidden = "no"


Func Hide()
    $hidden = "yes"
    If WinExists("" & $title) Then
        WinSetState("" & $title, "", @SW_HIDE)
        WinSetOnTop("" & $title, "", 0)
    EndIf
EndFunc ;==>Hide

Func Show()
    $hidden = "no"
    If WinExists("" & $title) Then
        WinSetState("" & $title, "", @SW_SHOW)
        WinSetOnTop("" & $title, "", 1)
    EndIf
EndFunc ;==>Show

Func Cikis()
    Exit
EndFunc ;==>Cikis
Edited by Sercankd

Share this post


Link to post
Share on other sites



The buttons you say do the wrong things aren't doing anything in the script you posted so we can't really say what is wrong.

For the teleport button you need to add something like this.

case $teleport
            ConsoleWrite(GUICtrlRead($tplist) & @CRLF)
            $text = FileRead(GUICtrlRead($tplist))
        ;do something with $textdo so

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

try lunar war button and click some textboxes

Share this post


Link to post
Share on other sites

try lunar war button and click some textboxes

You need to explain what you want to happen when you click on the lunar war button. There is no window with a title "Knight online Client" on my PC, and it looks like the parameters you have used for ControlSend are incorrect.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

the buttons in form they are all just send some text to knight online's chat frame but i cant get it work

Share this post


Link to post
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
Sign in to follow this  
Followers 0