Hey Leute, Wie kann man das machen das man ein limit setzt? Z.B.
man kann von 1 bis 40 eingeben wie würde da der code lauten? Thx $e*pvp/AutoIt
man kann von 1 bis 40 eingeben wie würde da der code lauten? Thx $e*pvp/AutoIt
If $LVL[1] > GuiCtrlRead($INP_LVL_MIN) And $LVL[1] < GuiCtrlRead($INP_LVL_MAX) Then
; Funktion
EndIf
#include <NomadMemory.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region GUI
GUICreate("Level", 167, 35, 192, 124)
GUISetBkColor(0xFFFFFF)
GUICtrlCreateLabel("Level:", 10, 10, 33, 17)
$INP_LVL_MIN = GUICtrlCreateInput("1", 50, 8, 27, 21, $ES_CENTER)
GUICtrlCreateLabel("-", 85, 10, 7, 17)
$INP_LVL_MAX = GUICtrlCreateInput("250", 100, 8, 27, 21, $ES_CENTER)
$Go = GUICtrlCreateButton("Go", 136, 8, 25, 22, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion GUI
While Sleep(10)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Go
Do
;...
$LVL = _MemoryPointerRead() ; _MemoryPointerRead ($iv_Address, $ah_Handle, $av_Offset, $sv_Type = 'dword')
If $LVL[1] > GuiCtrlRead($INP_LVL_MIN) And $LVL[1] < GuiCtrlRead($INP_LVL_MAX) Then
_angreifen()
EndIf
Until ; bis...
EndSwitch
WEnd
Func _angreifen()
; Funktion
EndFunc
If $input > 40 or $input < 1 Then
*ne Fehlermeldung + neue Inputbox*
EndIf
Quote:
Hey Leute, Wie kann man das machen das man ein limit setzt? Z.B.
man kann von 1 bis 40 eingeben wie würde da der code lauten? Thx $e*pvp/AutoIt
int x;
if(x<40 && x>0)
{
//dein code hier
}
was isn falsch? lol=( xDQuote:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Nomadmemory.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Battlefield 2 Trainer", 259, 138, 253, 296)
$Group1 = GUICtrlCreateGroup("Muni", 8, 8, 113, 97)
$Label1 = GUICtrlCreateLabel("Muni :", 16, 24, 33, 17)
$Input1 = GUICtrlCreateInput("", 56, 24, 57, 21)
$Button1 = GUICtrlCreateButton("set", 24, 64, 75, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Leben", 128, 8, 121, 97)
$Label3 = GUICtrlCreateLabel("Leben :", 136, 24, 40, 17)
$Input2 = GUICtrlCreateInput("", 176, 24, 65, 21)
$Button3 = GUICtrlCreateButton("set", 144, 64, 73, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label2 = GUICtrlCreateLabel("© Kauknochen", 24, 112, 124, 17)
$Button2 = GUICtrlCreateButton("Info", 160, 112, 89, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$pid = WinGetProcess("BF2")
$hprocess = _MemoryOpen($pid)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $button1
$write = _MemoryWrite(0xAdresse, $hprocess, GUICtrlRead($Input1))
case $button3
$write = _MemoryWrite(0xAdresse, $hprocess, GUICtrlRead($Input2))
case $button2
MsgBox(0,"Info","Made by Kauknochen")
EndSwitch
WEnd
If $input1 > 40 Then
MsgBox(0,"Fehler","1-40 nur erlaubt!") + Exit
EndIf
If $input2 > 50 Then
MsgBox(0,"Fehler","1-50 nur erlaubt!") + Exit
EndIf
passiert nixQuote:
case $button1
If $input1 > 40 or $input1 < 1 Then
Exit