Jump to content



Photo

Small minds...


  • Please log in to reply
11 replies to this topic

#1 shanet

shanet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 313 posts

Posted 16 December 2010 - 11:29 AM

Small things entertain small minds:


AutoIt         
#cs -----Small Things entertain Small Minds!----- -----Annoying little script put together by Shane Thompson because he has nothing better to do with his time... pretty sad, eh? -----I thought so two. grr who put that there? By the way, whoever you are, you are using the wrong to/too/two. It should be to. And its only annoying because u didn't know about how that mouse thing worked :P (neither did I, admitted it :D) #ce #include <GUIConstantsEX.au3> Opt("MustDeclareVars", 1) Global $winhandle, $infotext, $percent = 0, $progress, $submit = 2, $direction $winhandle = GUICreate("Small Minds", 300, 100) $infotext = GUICtrlCreateLabel("Overall Program Completion...    " &  $percent & " percent", 10, 180) $progress = GUICtrlCreateProgress(30, 30, 250) GUISetState() While 1     if $percent < 100 Then         $direction = 1     Else         $direction = 0     EndIf         While $direction         GUICtrlDelete($infotext)         $percent += 0.05         $infotext = GUICtrlCreateLabel("Overall Program Completion...    " &  $percent & " percent", 10, 180)         GUICtrlSetData($progress, $percent)         if $percent >= 100 Then             $direction = 0         EndIf         if GUIGetMsg() = $GUI_EVENT_CLOSE Then             Exit         EndIf     WEnd     While $direction = 0         GUICtrlDelete($infotext)         $percent -= 0.05         $infotext = GUICtrlCreateLabel("Overall Program Completion...    " &  $percent & " percent", 10, 180)         GUICtrlSetData($progress, $percent)         if $percent <= 0 Then             $direction = 1         EndIf         if GUIGetMsg() = $GUI_EVENT_CLOSE Then             Exit         EndIf     WEnd            if $percent = 100 Then         sleep(500)         $submit = GUICtrlCreateButton("Exit", 250, 70, 40)     EndIf     if GUIGetMsg() = $GUI_EVENT_CLOSE or GUIGetMsg() = $submit Then         Exit     EndIf WEnd



:x
shanet


--EDIT: A fun little bug I found... If you move the mouse, the progress bar speeds up! PHUN!

Edited by shanet, 06 April 2011 - 01:58 PM.

My code does not have bugs! It just develops random features.My ProjectsPure randomness
  • Small Minds.......................................................................................................Simple progress bar that changes direction at either sides.
  • ChristmasIt AutoIt Christmas Theme..........................................................I WAS BOOOORED!
  • DriveToy..............................................................................................................Simple joke script. Trick your friends into thinking their computer drive is haywire!
In Development
  • Your Background Task Organiser
  • AInstall Second Generation
BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm





#2 James

James

    jbrooksuk

  • MVPs
  • 9,468 posts

Posted 16 December 2010 - 11:41 AM

Posted Image

My mind hurts.

If I let the code run by itself, it's pretty slow. If I move my mouse, it speeds up. Posted Image

What. The. Fuck.

There is no Mouse*() functions even there.

#3 Manadar

Manadar

    Taking a REST.

  • MVPs
  • 10,714 posts

Posted 16 December 2010 - 12:07 PM

Posted Image

My mind hurts.

If I let the code run by itself, it's pretty slow. If I move my mouse, it speeds up. Posted Image

What. The. Fuck.

There is no Mouse*() functions even there.

I think that's because GUIGetMsg returns a mouse event if you move your mouse and the window is active. If there are no events, GUIGetMsg will wait a very very very short time to see if there are any events coming to the queue, that or it asks the queue to "refresh" itself when there are no messages just to make sure.

#4 shanet

shanet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 313 posts

Posted 16 December 2010 - 12:10 PM

If I let the code run by itself, it's pretty slow. If I move my mouse, it speeds up.


You can speed it up if you want, i guess, I dont think its illegal, is it??? If it is then you better arrest me two coz i set the speeds to begin with so I would be violating the law the most :x

I'm sure you can handle speeding it up.
shanet
My code does not have bugs! It just develops random features.My ProjectsPure randomness
  • Small Minds.......................................................................................................Simple progress bar that changes direction at either sides.
  • ChristmasIt AutoIt Christmas Theme..........................................................I WAS BOOOORED!
  • DriveToy..............................................................................................................Simple joke script. Trick your friends into thinking their computer drive is haywire!
In Development
  • Your Background Task Organiser
  • AInstall Second Generation
BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

#5 MvGulik

MvGulik

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,795 posts

Posted 16 December 2010 - 05:46 PM

If I let the code run by itself, it's pretty slow. If I move my mouse, it speeds up. Posted Image

@general:
Just some code that shows this behavior really good. -> #774
(some other somewhat related topic, http://www.autoitscript.com/forum/topic/115851-solved-guigetmsg-and-trayicontraygetmsg )
Don't Fall in Love With Ideas"If you fall in love with an idea, you won't see the merits of alternative approaches -- and will probably miss an opportunity or two. One of life's great pleasures is letting go of a previously cherished idea. Then you're free to look for new ones. What part of your idea are you in love with? What would happen if you kissed it goodbye?"

#6 shanet

shanet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 313 posts

Posted 16 December 2010 - 07:55 PM

Hehe I like this bug, it makes my program all the more retarded and stupid :x

I'm sorry program, I didnt mean it!
My code does not have bugs! It just develops random features.My ProjectsPure randomness
  • Small Minds.......................................................................................................Simple progress bar that changes direction at either sides.
  • ChristmasIt AutoIt Christmas Theme..........................................................I WAS BOOOORED!
  • DriveToy..............................................................................................................Simple joke script. Trick your friends into thinking their computer drive is haywire!
In Development
  • Your Background Task Organiser
  • AInstall Second Generation
BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

#7 MvGulik

MvGulik

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 2,795 posts

Posted 16 December 2010 - 09:29 PM

Posted Image

What bug? No bug to be found as far I can see.

(#774 was fixed, and the "GUIGetMsg() speedup on mouse movement" part is just a logical side effect of the implemented auto sleep inside GUIGetMsg())
Don't Fall in Love With Ideas"If you fall in love with an idea, you won't see the merits of alternative approaches -- and will probably miss an opportunity or two. One of life's great pleasures is letting go of a previously cherished idea. Then you're free to look for new ones. What part of your idea are you in love with? What would happen if you kissed it goodbye?"

#8 AZJIO

AZJIO

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 996 posts

Posted 17 December 2010 - 02:10 AM

shanet

To boil the brain


Plain Text         
Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG' $Gui = GUICreate("Poll for statistics", 450, 260) $Button=GUICtrlCreateButton('Yes', 66, 110, 88, 30) $ButtonN=GUICtrlCreateButton('No', 266, 110, 88, 30) GUICtrlCreateLabel("Want to get a gift?", 0, 0,450, 44, 0x01+0x0200) GUICtrlSetFont(-1,15) GUISetState () GUIRegisterMsg(0x004E, "WM_NOTIFY") Global $BtnXY = ControlGetPos($Gui, "", $Button) While 1    $msg = GUIGetMsg()    Select        Case $msg = $Button            MsgBox(0, 'Message', 'Ooo!')        Case $msg = $ButtonN            MsgBox(0, 'Message', "It's very strange.")        Case $msg = -3            Exit    EndSelect WEnd Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)         #forceref $hWnd, $Msg, $wParam     Local Const $BCN_HOTITEMCHANGE = -1249     Local $tNMBHOTITEM = DllStructCreate("hwnd hWndFrom;int IDFrom;int Code;dword dwFlags", $lParam)     Local $nNotifyCode = DllStructGetData($tNMBHOTITEM, "Code")     Local $dwFlags = DllStructGetData($tNMBHOTITEM, "dwFlags")     Local $nID = DllStructGetData($tNMBHOTITEM, "IDFrom")         If $nNotifyCode=$BCN_HOTITEMCHANGE Then         If BitAND($dwFlags, 0x10) = 0x10 And $nID = $Button Then             $CP = MouseGetPos()             $aCur_Info = GUIGetCursorInfo($Gui)             If $aCur_Info[1]<$BtnXY[1]+$BtnXY[3]+2 And $aCur_Info[1]>$BtnXY[1]+$BtnXY[3]-17 And $aCur_Info[0]>$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1]-$BtnXY[3])                 MouseMove($CP[0], $CP[1]-$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+$BtnXY[3]+2 And $aCur_Info[1]>$BtnXY[1]+$BtnXY[3]-17 And $aCur_Info[0]<=$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1]-$BtnXY[3])                 MouseMove($CP[0], $CP[1]-$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+17 And $aCur_Info[1]>$BtnXY[1]-2 And $aCur_Info[0]>$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1]+$BtnXY[3])                 MouseMove($CP[0], $CP[1]+$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+17 And $aCur_Info[1]>$BtnXY[1]-2 And $aCur_Info[0]<=$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1]+$BtnXY[3])                 MouseMove($CP[0], $CP[1]+$BtnXY[3])                 BlockInput(0)             EndIf         EndIf      EndIf     Return $GUI_RUNDEFMSG EndFunc


#9 shanet

shanet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 313 posts

Posted 17 December 2010 - 05:05 PM

Posted Image

What bug? No bug to be found as far I can see.

(#774 was fixed, and the "GUIGetMsg() speedup on mouse movement" part is just a logical side effect of the implemented auto sleep inside GUIGetMsg())



There are no bugs. My programs don't have bugs, they just develop random features! (This script is a good example!)
My code does not have bugs! It just develops random features.My ProjectsPure randomness
  • Small Minds.......................................................................................................Simple progress bar that changes direction at either sides.
  • ChristmasIt AutoIt Christmas Theme..........................................................I WAS BOOOORED!
  • DriveToy..............................................................................................................Simple joke script. Trick your friends into thinking their computer drive is haywire!
In Development
  • Your Background Task Organiser
  • AInstall Second Generation
BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

#10 shanet

shanet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 313 posts

Posted 17 December 2010 - 05:07 PM

shanet

To boil the brain


Plain Text         
Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG' $Gui = GUICreate("Poll for statistics", 450, 260) $Button=GUICtrlCreateButton('Yes', 66, 110, 88, 30) $ButtonN=GUICtrlCreateButton('No', 266, 110, 88, 30) GUICtrlCreateLabel("Want to get a gift?", 0, 0,450, 44, 0x01+0x0200) GUICtrlSetFont(-1,15) GUISetState () GUIRegisterMsg(0x004E, "WM_NOTIFY") Global $BtnXY = ControlGetPos($Gui, "", $Button) While 1    $msg = GUIGetMsg()    Select        Case $msg = $Button            MsgBox(0, 'Message', 'Ooo!')        Case $msg = $ButtonN            MsgBox(0, 'Message', "It's very strange.")        Case $msg = -3            Exit    EndSelect WEnd Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)         #forceref $hWnd, $Msg, $wParam     Local Const $BCN_HOTITEMCHANGE = -1249     Local $tNMBHOTITEM = DllStructCreate("hwnd hWndFrom;int IDFrom;int Code;dword dwFlags", $lParam)     Local $nNotifyCode = DllStructGetData($tNMBHOTITEM, "Code")     Local $dwFlags = DllStructGetData($tNMBHOTITEM, "dwFlags")     Local $nID = DllStructGetData($tNMBHOTITEM, "IDFrom")         If $nNotifyCode=$BCN_HOTITEMCHANGE Then         If BitAND($dwFlags, 0x10) = 0x10 And $nID = $Button Then             $CP = MouseGetPos()             $aCur_Info = GUIGetCursorInfo($Gui)             If $aCur_Info[1]<$BtnXY[1]+$BtnXY[3]+2 And $aCur_Info[1]>$BtnXY[1]+$BtnXY[3]-17 And $aCur_Info[0]>$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1]-$BtnXY[3])                 MouseMove($CP[0], $CP[1]-$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+$BtnXY[3]+2 And $aCur_Info[1]>$BtnXY[1]+$BtnXY[3]-17 And $aCur_Info[0]<=$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1]-$BtnXY[3])                 MouseMove($CP[0], $CP[1]-$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+17 And $aCur_Info[1]>$BtnXY[1]-2 And $aCur_Info[0]>$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1]+$BtnXY[3])                 MouseMove($CP[0], $CP[1]+$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+17 And $aCur_Info[1]>$BtnXY[1]-2 And $aCur_Info[0]<=$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1]+$BtnXY[3])                 MouseMove($CP[0], $CP[1]+$BtnXY[3])                 BlockInput(0)             EndIf         EndIf      EndIf     Return $GUI_RUNDEFMSG EndFunc

That's pretty cool, are you meant to be able to press the button though?
Well if you arent, I did, and also maybe we could have a macro to click it anyway if u cant and u still cant (:x)
My code does not have bugs! It just develops random features.My ProjectsPure randomness
  • Small Minds.......................................................................................................Simple progress bar that changes direction at either sides.
  • ChristmasIt AutoIt Christmas Theme..........................................................I WAS BOOOORED!
  • DriveToy..............................................................................................................Simple joke script. Trick your friends into thinking their computer drive is haywire!
In Development
  • Your Background Task Organiser
  • AInstall Second Generation
BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

#11 Ace08

Ace08

    Prodigy

  • Active Members
  • PipPipPip
  • 158 posts

Posted 21 December 2010 - 01:14 AM

shanet

To boil the brain


Plain Text         
Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG' $Gui = GUICreate("Poll for statistics", 450, 260) $Button=GUICtrlCreateButton('Yes', 66, 110, 88, 30) $ButtonN=GUICtrlCreateButton('No', 266, 110, 88, 30) GUICtrlCreateLabel("Want to get a gift?", 0, 0,450, 44, 0x01+0x0200) GUICtrlSetFont(-1,15) GUISetState () GUIRegisterMsg(0x004E, "WM_NOTIFY") Global $BtnXY = ControlGetPos($Gui, "", $Button) While 1    $msg = GUIGetMsg()    Select        Case $msg = $Button            MsgBox(0, 'Message', 'Ooo!')        Case $msg = $ButtonN            MsgBox(0, 'Message', "It's very strange.")        Case $msg = -3            Exit    EndSelect WEnd Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)         #forceref $hWnd, $Msg, $wParam     Local Const $BCN_HOTITEMCHANGE = -1249     Local $tNMBHOTITEM = DllStructCreate("hwnd hWndFrom;int IDFrom;int Code;dword dwFlags", $lParam)     Local $nNotifyCode = DllStructGetData($tNMBHOTITEM, "Code")     Local $dwFlags = DllStructGetData($tNMBHOTITEM, "dwFlags")     Local $nID = DllStructGetData($tNMBHOTITEM, "IDFrom")         If $nNotifyCode=$BCN_HOTITEMCHANGE Then         If BitAND($dwFlags, 0x10) = 0x10 And $nID = $Button Then             $CP = MouseGetPos()             $aCur_Info = GUIGetCursorInfo($Gui)             If $aCur_Info[1]<$BtnXY[1]+$BtnXY[3]+2 And $aCur_Info[1]>$BtnXY[1]+$BtnXY[3]-17 And $aCur_Info[0]>$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1]-$BtnXY[3])                 MouseMove($CP[0], $CP[1]-$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+$BtnXY[3]+2 And $aCur_Info[1]>$BtnXY[1]+$BtnXY[3]-17 And $aCur_Info[0]<=$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1]-$BtnXY[3])                 MouseMove($CP[0], $CP[1]-$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+17 And $aCur_Info[1]>$BtnXY[1]-2 And $aCur_Info[0]>$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]+$BtnXY[2]-$aCur_Info[0], $CP[1]+$BtnXY[3])                 MouseMove($CP[0], $CP[1]+$BtnXY[3])                 BlockInput(0)             EndIf             If $aCur_Info[1]<$BtnXY[1]+17 And $aCur_Info[1]>$BtnXY[1]-2 And $aCur_Info[0]<=$BtnXY[0]+$BtnXY[2]/2 Then                 BlockInput(1)                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1])                 MouseMove($CP[0]+$BtnXY[0]-$aCur_Info[0], $CP[1]+$BtnXY[3])                 MouseMove($CP[0], $CP[1]+$BtnXY[3])                 BlockInput(0)             EndIf         EndIf      EndIf     Return $GUI_RUNDEFMSG EndFunc

nice! wanna get a gift press Tab :x

@shanet
wow would you mind if i use this? :P
just wanna know how this works

Edited by Ace08, 21 December 2010 - 01:16 AM.

Work smarter not harder.My First Posted Script: DataBase

#12 shanet

shanet

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 313 posts

Posted 21 December 2010 - 06:51 AM

nice! wanna get a gift press Tab :x

@shanet
wow would you mind if i use this? :P
just wanna know how this works


Ace08, This is not my script, this is AZJIO's script, but everything posted here is Open Source (you can take the code and compile it, and if you edit it you can claim your edits, with credits to the original author), unless otherwise specified.

So, yes.

shanet
My code does not have bugs! It just develops random features.My ProjectsPure randomness
  • Small Minds.......................................................................................................Simple progress bar that changes direction at either sides.
  • ChristmasIt AutoIt Christmas Theme..........................................................I WAS BOOOORED!
  • DriveToy..............................................................................................................Simple joke script. Trick your friends into thinking their computer drive is haywire!
In Development
  • Your Background Task Organiser
  • AInstall Second Generation
BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users