Register for your free account! | Forgot your password?

You last visited: Today at 18:21

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Frage

Discussion on Frage within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
~kau~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 634
Received Thanks: 794
Question Frage

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
~kau~ is offline  
Old 01/07/2010, 18:03   #2
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
Immer noch Rappelz Bot?

Ich würs so machen:
- Level aus der Memory lesen ($LVL)
- 2 Inputboxen (ich nenn sie mal $INP_LVL_MIN und $INP_LVL_MAX)

und dann so:
PHP Code:
If $LVL[1] > GuiCtrlRead($INP_LVL_MIN) And $LVL[1] < GuiCtrlRead($INP_LVL_MAXThen
Funktion
EndIf 
KDeluxe is offline  
Old 01/07/2010, 18:34   #3
 
~kau~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 634
Received Thanks: 794
Ne bf^^ die adressen hab ich nur net das prinzip
~kau~ is offline  
Old 01/07/2010, 19:55   #4
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
PHP Code:
#include <NomadMemory.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region GUI
GUICreate("Level"16735192124)
GUISetBkColor(0xFFFFFF)
GUICtrlCreateLabel("Level:"10103317)
$INP_LVL_MIN GUICtrlCreateInput("1"5082721$ES_CENTER)
GUICtrlCreateLabel("-"8510717)
$INP_LVL_MAX GUICtrlCreateInput("250"10082721$ES_CENTER)
$Go GUICtrlCreateButton("Go"13682522$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_MAXThen
                    _angreifen
()
                EndIf
            
Until bis...
    EndSwitch
WEnd

Func _angreifen
()
    ; 
Funktion
EndFunc 
Geklärt?
KDeluxe is offline  
Old 01/07/2010, 21:22   #5
 
elite*gold: 1
Join Date: Oct 2008
Posts: 1,078
Received Thanks: 276
PHP Code:
If $input 40 or $input 1 Then
*ne Fehlermeldung neue Inputbox*
EndIf 
primitiv aber funktioniert^^
.nAno is offline  
Old 01/07/2010, 22:08   #6
 
Xereon's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 793
Received Thanks: 366
For-Schleifen ftw!

Edit:

In Puncto Scanner sind jedoch Do-Schleifen zu empfehlen: Speed
Xereon is offline  
Old 01/07/2010, 22:13   #7
 
elite*gold: 0
Join Date: Apr 2006
Posts: 6,597
Received Thanks: 1,830
Quote:
Originally Posted by kauknochen View Post
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
Code:
int x;

if(x<40 && x>0)
{
//dein code hier
}
edit: ups sry nicht gesehen ,dass du das ganze in autoit code suchst. Naja schau wenn dir das Prinzip hinter meinem code snippet klar ist sollts kein ding sein das in autoit umzuschreiben.
Medix is offline  
Old 01/08/2010, 14:26   #8
 
~kau~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 634
Received Thanks: 794
Naja^^ also ich hab das mal so ausprobiert kommt kein Fehler aber passiert auch nix xD
Quote:
#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
was isn falsch? lol=( xD
Edit noch was gibt es ein befehl da sman das value freezen kann? wie z.B _MemoryFreeze oder so?
~kau~ is offline  
Old 01/08/2010, 14:48   #9
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
Hab noch nie was davon gehört, du musst die Funktion einfach in eine Schleife packen

Buttons eignen sich nicht, um das Value zu freezen (funktioniert bei einem Trainer, der mit Cheat Engine erstellt wurde auch nicht)
KDeluxe is offline  
Old 01/08/2010, 18:09   #10
 
~kau~'s Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 634
Received Thanks: 794
lol funtzt net^^
Quote:
case $button1
If $input1 > 40 or $input1 < 1 Then
Exit
passiert nix
~kau~ is offline  
Old 01/08/2010, 19:28   #11
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
Ich gib dir mal nen Tipp: GUICtrlRead($Input1)

Das du dein Script bei einer falschen Eingabe schließen möchtest ist schwachsinnig

Benutz lieber GUICtrlSetData($Input1, "1") oder so was ähnliches
KDeluxe is offline  
Old 01/09/2010, 10:58   #12
 
elite*gold: 1
Join Date: Oct 2008
Posts: 1,078
Received Thanks: 276
das schließen ist echt schwachsinnig, ich denk mal das sollte ne beispielfunktion sein oder?

Außerdem könnte es sein das du nen EndIf vergessen hast (obwohl dann auch ne Fehlermeldung kommen sollte

Außerdem ist meine Scriptzeile nur dazu geeignet nen Fehler festzustellen, nicht etwas zu tun wenn die Angabe richtig ist...

E: Wie eig schon gesagt solltest du auch ne Do-Schleife einbauen da ansonsten die falschen Angaben vom User nicht korregiert werden, sondern einfach mit denen weitergearbeitet wird^^
.nAno is offline  
Reply




All times are GMT +2. The time now is 18:21.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.