|
You last visited: Today at 19:54
Advertisement
[HELP] Macro: Spam Text
Discussion on [HELP] Macro: Spam Text within the AutoIt forum part of the Coders Den category.
05/08/2009, 20:13
|
#1
|
elite*gold: 0
Join Date: Apr 2009
Posts: 1
Received Thanks: 0
|
[HELP] Macro: Spam Text
I have help spam for me in-game. Not sure how I write to different key named msg1...msg6 ini file. I pass global variable but become local in _txtwrite() function. When I pass 1 more, it no change. Still write same key as pass by first variable and go through condition. Here is code to help through this struggle? And maybe figure easy way to write code in other way?
PHP Code:
#include <GUIConstantsEx.au3> #include <EditConstants.au3> #Include <GuiButton.au3> #Include <GuiEdit.au3>
Opt("GUICoordMode", 1) Opt("GUIOnEventMode", 1) ; Change to OnEvent Mode
; Create GUI Window $MainWindow = GUICreate("sendtxt (LC)", 230, 90)
; Create Menu $File = GUICtrlCreateMenu("File") $Close = GUICtrlCreateMenuItem("Close", $File) GUICtrlSetOnEvent($Close, "_Close") ; GUICtrlSetOnEvent waits for user's input. Once received, it will then run the assigned function $Edit = GUICtrlCreateMenu("Edit") $Msg01m = GUICtrlCreateMenuItem("MSG01", $Edit) GUICtrlSetOnEvent($Msg01m, "_msg01") $Msg02m = GUICtrlCreateMenuItem("MSG02", $Edit) GUICtrlSetOnEvent($Msg02m, "_msg02") $Msg03m = GUICtrlCreateMenuItem("MSG03", $Edit) GUICtrlSetOnEvent($Msg03m, "_msg03") $Msg04m = GUICtrlCreateMenuItem("MSG04", $Edit) GUICtrlSetOnEvent($Msg04m, "_msg04") $Msg05m = GUICtrlCreateMenuItem("MSG05", $Edit) GUICtrlSetOnEvent($Msg05m, "_msg05") $Msg06m = GUICtrlCreateMenuItem("MSG06", $Edit) GUICtrlSetOnEvent($Msg06m, "_msg06") $About = GUICtrlCreateMenu("About") $Info = GUICtrlCreateMenuItem("Info", $About) GUICtrlSetOnEvent($Info, "_Info") $Help = GUICtrlCreateMenuItem("Help File", $About) GUICtrlSetOnEvent($Help, "_Help")
; Create MSG Box $Msg01 = GUICtrlCreateButton("MSG01", 5, -1+5) GUICtrlSetOnEvent($Msg01, "_msg01") $Msg02 = GUICtrlCreateButton("MSG02", 55, -1+5) GUICtrlSetOnEvent($Msg02, "_msg01") $Msg03 = GUICtrlCreateButton("MSG03", 105, -1+5) GUICtrlSetOnEvent($Msg03, "_msg01") $Msg04 = GUICtrlCreateButton("MSG04", 5, -1+40) GUICtrlSetOnEvent($Msg04, "_msg01") $Msg05 = GUICtrlCreateButton("MSG05", 55, -1+40) GUICtrlSetOnEvent($Msg05, "_msg01") $Msg06 = GUICtrlCreateButton("MSG06", 105, -1+40) GUICtrlSetOnEvent($Msg06, "_msg01") $Save = GUICtrlCreateButton("SAVE", 155, -1+5, 60, 60) GUICtrlSetTip($Save, "Save Changes") GUICtrlSetOnEvent($Save, "_Save")
; Set state to display GUI Window GUISetState(@SW_SHOW)
; Wait for user's input While (1) Sleep(1000) WEnd
Func _main_edit_ctrl() Global $EditWindow = GUICreate("Msg01", 200, 150, Default, Default, Default, Default, $MainWindow) GUISetState(@SW_SHOW) $txtedit = GUICtrlCreateEdit("", -1, -1, 200, 100, $ES_MULTILINE) $txteditOK = GUICtrlCreateButton("OK!", 12, 115, 175) Do Global $txtRead = GUICtrlRead($txtedit) Until _GUICtrlButton_GetState($txteditOK) EndFunc ; function($key) <== don't forget Func _txtwrite() ; $FileSize = _GUICtrlEdit_GetTextLen($txtRead) ; If $FileSize <= 249 Then If $key = 1 Then IniWrite(@ScriptDir & "\sendtxt.ini","TEXT","msg1", $txtRead) GUIDelete($EditWindow) ElseIf $key = 2 Then IniWrite(@ScriptDir & "\sendtxt.ini","TEXT","msg2", $txtRead) GUIDelete($EditWindow) ElseIf $key = 3 Then IniWrite(@ScriptDir & "\sendtxt.ini","TEXT","msg3", $txtRead) GUIDelete($EditWindow) ElseIf $key = 4 Then IniWrite(@ScriptDir & "\sendtxt.ini","TEXT","msg4", $txtRead) GUIDelete($EditWindow) ElseIf $key = 5 Then IniWrite(@ScriptDir & "\sendtxt.ini","TEXT","msg5", $txtRead) GUIDelete($EditWindow) ElseIf $key = 6 Then IniWrite(@ScriptDir & "\sendtxt.ini","TEXT","msg6", $txtRead) GUIDelete($EditWindow) Else ;MsgBox(0, "DENIED!", "Message cannot be longer than 250: " &$FileSize) EndIf ; EndIf EndFunc
; Every _msgxx function writes saved data to .ini Func _msg01() $key = 1 _main_edit_ctrl() EndFunc Func _msg02() $key = 2 _main_edit_ctrl() EndFunc Func _msg03() $key = 3 _main_edit_ctrl() EndFunc Func _msg04() $key = 4 _main_edit_ctrl() EndFunc Func _msg05() $key = 5 _main_edit_ctrl() EndFunc Func _msg06() $key = 6 _main_edit_ctrl() EndFunc
; Save Changes Func _Save() EndFunc
; Information about the program Func _Info() EndFunc
; Help File on how to Operate Func _Help() EndFunc
; Exit Func _Close() If @GUI_WINHANDLE = $MainWindow Then Exit EndIf EndFunc
|
|
|
05/15/2009, 14:41
|
#2
|
elite*gold: 120
Join Date: Mar 2007
Posts: 392
Received Thanks: 406
|
Code:
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
;Variables to edit
Global $windowTitle = "World of Warcraft" ;send message to this window
;--------------------
Global $GUI_EditWindow ;hwdn of edit window
Global $FileName = @ScriptDir & "\sendtxt.ini"
Global $lastCtrlId
Global $txtedit
Opt("GUIOnEventMode", 1) ; Change to OnEvent Mode
; Create GUI Window
Global $GUI = GUICreate("sendtxt (LC)", 230, 90)
; Menu File
$File = GUICtrlCreateMenu("File")
$Close = GUICtrlCreateMenuItem("Close", $File)
; Menu Edit
$Edit = GUICtrlCreateMenu("Edit")
$Msg01m = GUICtrlCreateMenuItem("MSG01", $Edit)
$Msg02m = GUICtrlCreateMenuItem("MSG02", $Edit)
$Msg03m = GUICtrlCreateMenuItem("MSG03", $Edit)
$Msg04m = GUICtrlCreateMenuItem("MSG04", $Edit)
$Msg05m = GUICtrlCreateMenuItem("MSG05", $Edit)
$Msg06m = GUICtrlCreateMenuItem("MSG06", $Edit)
; Menu About
$About = GUICtrlCreateMenu("About")
$Info = GUICtrlCreateMenuItem("Info", $About)
$Help = GUICtrlCreateMenuItem("Help File", $About)
;set Events for Menu
GUICtrlSetOnEvent($Close, "_Close") ; GUICtrlSetOnEvent waits for user's input. Once received, it will then run the assigned function
GUICtrlSetOnEvent($Msg01m, "_msgEdit")
GUICtrlSetOnEvent($Msg02m, "_msgEdit")
GUICtrlSetOnEvent($Msg03m, "_msgEdit")
GUICtrlSetOnEvent($Msg04m, "_msgEdit")
GUICtrlSetOnEvent($Msg05m, "_msgEdit")
GUICtrlSetOnEvent($Msg06m, "_msgEdit")
GUICtrlSetOnEvent($Info, "_Info")
GUICtrlSetOnEvent($Help, "_Help")
; Buttons
Global $Msg01 = GUICtrlCreateButton("MSG01", 5, -1+5)
Global $Msg02 = GUICtrlCreateButton("MSG02", 55, -1+5)
Global $Msg03 = GUICtrlCreateButton("MSG03", 105, -1+5)
Global $Msg04 = GUICtrlCreateButton("MSG04", 5, -1+40)
Global $Msg05 = GUICtrlCreateButton("MSG05", 55, -1+40)
Global $Msg06 = GUICtrlCreateButton("MSG06", 105, -1+40)
; set Events for Buttons
GUICtrlSetOnEvent($Msg01, "_msgSend")
GUICtrlSetOnEvent($Msg02, "_msgSend")
GUICtrlSetOnEvent($Msg03, "_msgSend")
GUICtrlSetOnEvent($Msg04, "_msgSend")
GUICtrlSetOnEvent($Msg05, "_msgSend")
GUICtrlSetOnEvent($Msg06, "_msgSend")
; Set state to display GUI Window
_SetButtonState()
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE,"_Close")
; Wait for user's input
While 1
sleep(1000)
WEnd
; Send the message to the WindowTitle with ControlSend
Func _msgSend()
Local $message = IniRead($FileName, "Text", GUICtrlRead(@GUI_CtrlId,1), "")
if $message Then
ControlSend($windowTitle, "", 0, $message)
Else
_msgEdit()
EndIf
EndFunc
; Edit the Message, get last Control Id
Func _msgEdit()
$lastCtrlId = @GUI_CtrlId
_editCtrl()
EndFunc
; Edit MSG with a new GUI
Func _editCtrl()
GUISetState(@SW_DISABLE, $GUI) ;disable main gui
$GUI_EditWindow = GUICreate("Edit " & GUICtrlRead($lastCtrlId, 1), 200, 150)
$txtedit = GUICtrlCreateEdit(IniRead($FileName, "Text", GUICtrlRead(@GUI_CtrlId,1), ""), -1, -1, 200, 100, $ES_MULTILINE)
$txteditOK = GUICtrlCreateButton("OK!", 12, 115, 175)
GUICtrlSetOnEvent($txteditOK, "_SaveMsg")
GUISetState(@SW_SHOW)
EndFunc
; Save Changes
Func _SaveMsg()
IniWrite($FileName, "Text", GUICtrlRead($lastCtrlId,1), GUICtrlRead($txtedit))
;set state of buttons
GUICtrlSetState($lastCtrlId,$GUI_ENABLE)
_SetButtonState()
_Close()
EndFunc
; Information about the program
Func _Info()
MsgBox(64,"Info","edit by PiroX - www.PiroxBots.com")
EndFunc
; Help File on how to Operate
Func _Help()
EndFunc
; Exit & GuiDelete
Func _Close()
if @GUI_WinHandle = $GUI Then
Exit
Else
GUIDelete($GUI_EditWindow)
GUISetState(@SW_ENABLE,$GUI)
WinActivate($GUI)
EndIf
EndFunc
Func _SetButtonState()
if not IniRead($FileName, "Text", GUICtrlRead($Msg01,1), "") Then GUICtrlSetState($Msg01, $GUI_DISABLE)
if not IniRead($FileName, "Text", GUICtrlRead($Msg02,1), "") Then GUICtrlSetState($Msg02, $GUI_DISABLE)
if not IniRead($FileName, "Text", GUICtrlRead($Msg03,1), "") Then GUICtrlSetState($Msg03, $GUI_DISABLE)
if not IniRead($FileName, "Text", GUICtrlRead($Msg04,1), "") Then GUICtrlSetState($Msg04, $GUI_DISABLE)
if not IniRead($FileName, "Text", GUICtrlRead($Msg05,1), "") Then GUICtrlSetState($Msg05, $GUI_DISABLE)
if not IniRead($FileName, "Text", GUICtrlRead($Msg06,1), "") Then GUICtrlSetState($Msg06, $GUI_DISABLE)
EndFunc
|
|
|
 |
Similar Threads
|
HowTo: bypass CD/GCD with macro spam
01/04/2012 - General Gaming Releases - 36 Replies
Da ich nun erneut vermehrt von Leuten angesprochen werde, die nicht einsehen wollen das mein Beitrag zur Funktionsweise dieses Tricks keine Anleitung sein sollte, erstelle ich nun doch noch ein Tutorial das veranschaulicht wie genau das all die Cheater da draußen in WAR so machen.
Wie ist so etwas möglich?
An sich recht simpel - Da die Server mit einer Latenz zwischen 1 und 2 Sekunden arbeiten (Das Problem, warum man aus 200 Metern noch angegriffen werden kann - auch Lagschatten genannt...
|
Keyboard Macro for fast spam skills
05/24/2010 - Rappelz - 1 Replies
Guys is there any keyboard macro available to spams the skills faster in rappelz... Help plzz...
|
met spam macro
09/12/2006 - Conquer Online 2 - 0 Replies
Guys, I spam average 500 mets per week...it takes quite a while, do u think anyone could make a met spam macro tht buys item from npc, opens scrolls, and sells/drops the item after its been spammed? no rush, but i would love it if someone made it, idc if it stops after soc or not, id be watching it spam the whole time...plz help
|
All times are GMT +1. The time now is 19:55.
|
|