1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. jangxx

Beiträge von jangxx

  • Bild auf Kommando mit einstellbarer Geschwindigkeit drehen

    • jangxx
    • 1. Juni 2010 um 20:19

    Hab eure Beispiele jetzt zusammengefasst; Hier das Ergebnis:

    Spoiler anzeigen
    [autoit]

    #include <GDIplus.au3>
    #include <GUIConstants.au3>
    #include <EditConstants.au3>
    Opt("GUIOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_Startup()
    Global $Stator = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Stator.png")
    Global $Rotor = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Rotor_small.png")
    Global $Schleifkontakte = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Schleifkontakte.png")
    Global $width = _GDIPlus_ImageGetWidth($Stator)
    Global $height = _GDIPlus_ImageGetHeight($Stator)

    [/autoit] [autoit][/autoit] [autoit]

    Global $dx = _GDIPlus_ImageGetWidth($Rotor)
    Global $dy = _GDIPlus_ImageGetHeight($Rotor)

    [/autoit] [autoit][/autoit] [autoit]

    Global $i

    [/autoit] [autoit][/autoit] [autoit]

    Global $hWnd = GUICreate("Elektromotor by Jan Scheiper mit freundlicher Mithilfe von UEZ & name22", 704, 780, -1, -1, Default)
    GUICtrlCreateLabel("Wert:",50,733)
    $slider = GUICtrlCreateSlider(50,670,604,34)
    $speed = GUICtrlCreateInput("0",80,730,30,20,$ES_READONLY)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphics)
    Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)

    [/autoit] [autoit][/autoit] [autoit]

    Global $hFGBitmap = _GDIPlus_BitmapCreateFromGraphics($dx, $dy, $hGraphics)
    Global $hFGBackbuffer = _GDIPlus_ImageGetGraphicsContext($hFGBitmap)

    [/autoit] [autoit][/autoit] [autoit]

    Global $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, $dx / 2, $dy / 2)
    _GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)

    [/autoit] [autoit][/autoit] [autoit]

    Global $FG_x = 163
    Global $FG_y = 221
    Global $mid_x = $dx * 0.5
    Global $mid_y = $dy * 0.5

    [/autoit] [autoit][/autoit] [autoit]

    $i = 0

    [/autoit] [autoit][/autoit] [autoit]

    While Sleep(20)
    GUICtrlSetData($speed,GUICtrlRead($slider))
    $i = GUICtrlRead($speed)
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $Stator, 0, 0) ;draw background
    _GDIPlus_GraphicsClear($hFGBackbuffer, 0xFFFFFFFF) ;clear backbuffer from foreground graphics

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_MatrixRotate($hMatrix, $i, 0) ;rotate foreground graphic
    _GDIPlus_GraphicsSetTransform($hFGBackbuffer, $hMatrix)
    _GDIPlus_GraphicsDrawImage($hFGBackbuffer, $Rotor, -$mid_x, -$mid_y)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hFGBitmap, $FG_x, $FG_y, $dx, $dy) ;copy foreground backbuffer to main backbuffer
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $Schleifkontakte, 0, 0)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $width, $height) ;copy full drawn image to main screen

    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    _GDIPlus_BitmapDispose($Stator)
    _GDIPlus_BitmapDispose($Rotor)
    _GDIPlus_BitmapDispose($Schleifkontakte)
    _GDIPlus_BitmapDispose($hFGBitmap)
    _GDIPlus_GraphicsDispose($hFGBackbuffer)
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
    EndFunc

    [/autoit]

    Danke für die Hilfe

  • Bild auf Kommando mit einstellbarer Geschwindigkeit drehen

    • jangxx
    • 1. Juni 2010 um 19:09
    Zitat
    [autoit]

    _GDIPlus_MatrixRotate($hMatrix, 180, "False")
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)

    [/autoit]

    Wieso drehst du die Matrix ein Mal und bleibst danach in der GUI Schleife?
    Und das Bild wird auch nur ein Mal gezeichnet. :huh:

    Ich habe nicht bis zu Ende geschreiben weil er schon ein Bild nicht gedreht oder angezeigt hat.
    Ich habs direkt hier gepostet.

  • Bild auf Kommando mit einstellbarer Geschwindigkeit drehen

    • jangxx
    • 1. Juni 2010 um 17:45

    Für den Physikunterricht möchte ich ei programm schreiben welches das Drehen eines Elektromotors simulieren soll.
    Das Problem ist, dass kein Rotor angezeigt wird und das er sich nicht dreht.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <GDIPlus.au3>
    #Include <WinAPI.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    TrayTip("ACHTUNG!","Durch Klick auf dieses Symbol lässt sich das Programm beenden!!",1000)
    $hGUI = GUICreate("Elektromotor", 704, 780);,$DS_SETFOREGROUND))
    GUICtrlCreateLabel("Multiplikator",610,640)
    $combo = GUICtrlCreateCombo("",610,660,50,20)
    $slider = GUICtrlCreateSlider(200,660,400,30)
    $start = GUICtrlCreateButton("Strom an",50,660,100,30)
    GUICtrlCreateLabel("Anmerkungen:"&@CRLF&" -Das Programm lässt sich nicht durch Klick auf X oder 'Strom aus' beenden"&@CRLF&" -Durch den Slider lässt sich die Geschwindigkeit einstellen"&@CRLF&"DIESES PROGRAMM IST NOCH IM BETA-ZUSTAND; DIESE PROBLEME WERDEN GEFIXT!!",10,700)
    GUICtrlSetData($combo,"|1|2|3|4|5|6|","1")

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_StartUp()
    $hImageStator = _GDIPlus_ImageLoadFromFile("Stator.png")
    $hImageKontakt = _GDIPlus_ImageLoadFromFile("Schleifkontakte.png")
    $hGraphic1 = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hImageRotor = _GDIPlus_ImageLoadFromFile("rotor_small.png")
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImageRotor)

    [/autoit] [autoit][/autoit] [autoit]

    $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix,0,0)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_MatrixRotate($hMatrix, 180, "False")
    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImageRotor, 100, 100)

    [/autoit] [autoit][/autoit] [autoit]

    GUIRegisterMsg($WM_PAINT, "MY_WM_PAINT")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    Func MY_WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_UPDATENOW)
    _GDIPlus_GraphicsDrawImage($hGraphic1, $hImageStator, 0, 0)
    _GDIPlus_GraphicsDrawImage($hGraphic1, $hImageKontakt, 0, 0)
    _GDIPlus_GraphicsDrawImage($hGraphic, $hImageRotor, 100, 100)
    _WinAPI_RedrawWindow($hGUI, 0, 0, $RDW_VALIDATE)
    Return $GUI_RUNDEFMSG
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $start

    GUICtrlSetData($start,"Strom aus")

    Do
    $multi = GUICtrlRead($combo)
    $msg = GUIGetMsg()
    $speed = 100-GUICtrlRead($slider)
    Sleep($speed*$multi)
    $msg = GUIGetMsg()
    Sleep($speed*$multi)
    $msg = GUIGetMsg()
    Sleep($speed*$multi)
    $msg = GUIGetMsg()
    Sleep($speed*$multi)
    $msg = GUIGetMsg()
    Sleep($speed*$multi)
    $msg = GUIGetMsg()
    Sleep($speed*$multi)
    $msg = GUIGetMsg()
    Until $msg = $start
    If $msg = $GUI_EVENT_CLOSE Then Exit
    GUICtrlSetData($start,"Strom an")
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    EndSelect
    WEnd

    [/autoit]

    Was mache ich falsch?

    Dateien

    rotor_small.png 186,55 kB – 0 Downloads Schleifkontakte.png 22,04 kB – 0 Downloads Stator.png 188,13 kB – 0 Downloads
  • Mediatasten Simulator

    • jangxx
    • 28. Mai 2010 um 22:37

    Ging schon wie in Beitrag 2 danke

  • Mediatasten Simulator

    • jangxx
    • 28. Mai 2010 um 22:28

    Ich habe leider keine Tastatur mit Mediatasten deswegen habe ich mir ein Autoit programm geschrieben:

    [autoit]

    HotKeySet("^!m","activate")
    $activate = 0

    [/autoit][autoit][/autoit][autoit]

    Func activate()
    If $activate = 0 Then
    $activate = 1
    HotKeySet("{F2}","mute")
    HotKeySet("{F3}","voldown")
    HotKeySet("{F4}","volup")
    HotKeySet("{F5}","prevtrack")
    HotKeySet("{F6}","playpause")
    HotKeySet("{F7}","stoptrack")
    HotKeySet("{F8}","nexttrack")

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    Func voldown()
    Send("{VOLUME_DOWN}")
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func volup()
    Send("{VOLUME_UP}")
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func prevtrack()
    Send("{MEDIA_PREV}")
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func playpause()
    Send("{MEDIA_PLAY_PAUSE}")
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func stoptrack()
    Send("{MEDIA_STOP}")
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func nexttrack()
    Send("{MEDIA_NEXT}")
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    Func mute()
    Send("{VOLUME_MUTE}")
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    ElseIf $activate = 1 Then
    $activate = 0
    HotKeySet("{F2}")
    HotKeySet("{F3}")
    HotKeySet("{F4}")
    HotKeySet("{F5}")
    HotKeySet("{F6}")
    HotKeySet("{F7}")
    HotKeySet("{F8}")
    EndIf
    EndFunc

    [/autoit][autoit][/autoit][autoit]

    While 1
    Sleep(10)
    WEnd

    [/autoit]

    Das Problem ist, dass Autoit immer sage das func voldown() kein Endfunc hätte. Was kann ich tun? ?( ?(

  • Bot Problem

    • jangxx
    • 27. Mai 2010 um 18:37

    Hab ich nicht gelesen

  • Bot Problem

    • jangxx
    • 27. Mai 2010 um 18:34

    Ich versuche gerade einen aim-bot für das Spiel "Cube 2: Sauerbraten" zu scheiben. Das Problem ist, dass wenn das Spiel gestartet ist, das Script folgenden Fehler zeigt:

    Subscript used with non-Array variable.:
    MouseMove($pos[0],$pos[1],1)

    Wenn das Spiel nicht läuft funktioniert es aber (z.B auf den Desktop).

    Mein Code:

    [autoit]

    #include <GUIConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    $gui = GUICreate("Sauerbraten aim-bot v0.1",200,350)
    GUISetState(@SW_Show)
    $arginput = GUICtrlCreateInput("Argument angeben..",10,290,180)
    $argumentlabel = GUICtrlCreateLabel("Argument:",10,270)
    $patchedlabel = GUICtrlCreateLabel(IniRead("save.ini","patch","game","Nicht gepatched"),10,240)
    $pathlabel = GUICtrlCreateLabel(IniRead("save.ini","path","game","Kein Pfad angegeben"),10,220)
    $startwithargumentbutton = GUICtrlCreateButton("SB mit Argument starten",10,130,180,30)
    $launchbutton = GUICtrlCreateButton("Sauerbraten starten",10,10,180,30)
    $patchbutton = GUICtrlCreateButton("Sauerbraten patchen",10,50,180,30)
    $pathbutton = GUICtrlCreateButton("Sauerbratenpfad angeben",10,90,180,30)
    $autoclick = GUICtrlCreateCheckbox("Automatisch Klicken",10,170)
    $helptip = GUICtrlCreateCheckbox("Info Text anzeigen",10,190)

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $helptip
    If GUICtrlRead($helptip)=$GUI_CHECKED Then GUICtrlSetTip($arginput,"Argument angeben z.B: /connect sauerleague.org 30000")
    Case $msg = $pathbutton
    $path = FileSelectFolder("Sauerbrtenpfad angeben","Computer",1+2+4)
    IniWrite("save.ini","path","game",$path)
    GUICtrlSetData($pathlabel,$path)
    Case $msg = $launchbutton
    If GUICtrlRead($helptip) = $GUI_CHECKED Then MsgBox(1+64,"Wichtige Info","Der Bot zielt durch druck auf die f-Taste einmal auf ETWAS ROTES. Durch druck auf die F2-Taste lässt sich der Bot beenden.")
    ShellExecute(IniRead("save.ini","path","game",0)&"\sauerbraten.lnk")
    $funcaim = "autoaim"
    If GUICtrlRead($autoclick) = $GUI_CHECKED Then
    $funcaim = "autoclick"

    EndIf
    GUIDelete($gui)
    HotKeySet("f","autoaim")
    HotKeySet("{F2}","end")

    Func autoclick()
    $pos = PixelSearch(0,0,1680,1050,0xFF0000,50,2)
    MouseClick($pos[0],$pos[1],1,1)
    EndFunc

    Func autoaim()
    $pos = PixelSearch(0,0,1680,1050,0xFF0000,50,2)
    MouseMove($pos[0],$pos[1],1)
    EndFunc

    Func end()
    Exit
    EndFunc

    While 1
    Sleep(10)
    WEnd
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    EndSelect
    WEnd

    [/autoit]

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™