Jump to content

SirJohann

Active Members
  • Posts

    30
  • Joined

  • Last visited

About SirJohann

  • Birthday 07/05/1996

Profile Information

  • Location
    Somewhere.
  • Interests
    Gaming and programming.

SirJohann's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi guys, I was writing this simple code and I found that some weird happens. Please, ignore the code, I was just joking with friends. ToolTip('Press space to start the wiggle <3' & @CRLF & _ 'Press escape to stop the wiggle :(', 0, 0, 'WIGGLE WIGGLE WIGGLE', 0, 100) HotKeySet('{SPACE}', '_WiggleWiggleWiggle') HotKeySet('{ESC}', '_DontWiggleWiggleWiggle') Global $Wiggle = 0 Global $WiggleWiggle = '' Sleep(4000) While True Sleep(100) WEnd Func _WiggleWiggleWiggle() ToolTip('') While True For $Wiggle = 1 To Random(1, 5, 1) $WiggleWiggle &= 'WIGGLE ' Next Send($WiggleWiggle) Send('{ENTER}') $WiggleWiggle = '' Sleep(300) MsgBox(64, 'Title', $WiggleWiggle) WEnd EndFunc Func _DontWiggleWiggleWiggle() Exit EndFunc The bug is in the first function, and the cause is the space next to 'WIGGLE', If I write the space, the msgbox and the rest of the function is not called, and without the space it is. I really can't undestand why.
  2. Patience is a virtue. You don't need to install AutoIt, but you need Aut2Exe.
  3. ¿But is _OnCall called? I'm gonna try.
  4. Also tried, but anyways, when the console shows up and you close it it's like calling exit, it closes the program with exit code 0, but thanks.
  5. Hi guys. I've been working in a conversational adventure with AutoIt, but I have a problem. Is not a big problem, but If you can help me with it, that would be great. This is the code: #AutoIt3Wrapper_Run_Before = mkdir build #AutoIt3Wrapper_OutFile = build\ConsoleAdventure.exe #RequireAdmin ;~D #include 'WinAPI.au3' #include 'MsgBoxConstants.au3' ;~D #include 'include\Console.au3' ; Matt Diesel (Mat) #include 'include\AutoItObject.au3' ; monoceres, trancexx, Kip, Prog@ndy (license in docs\AutoItObject) _AutoItObject_Startup() OnAutoItExitRegister('_OnExit') Global $_oErrorHandler = ObjEvent('AutoIt.Error', '_OnObjectError') Global $_oConsole = _NewConsole() If Not $_oConsole.Alloc Then _WinAPI_ShowError('Error allocating the console') ;~D While True Sleep(100) WEnd Func _NewConsole() Local $oClass = _AutoItObject_Class() With $oClass .Create() .AddProperty('Alloc', $ELSCOPE_READONLY, _Console_Alloc()) EndWith Return $oClass.Object EndFunc Func _OnObjectError($oError) _WinAPI_ShowError($oError.windescription & 'Line: ' & $oError.scriptline) EndFunc Func _OnExit() MsgBox($MB_ICONINFORMATION, '_OnExit', True) ;~D _AutoItObject_Shutdown() EndFunc Everything works fine, but _OnExit is never called. I tried with SetConsoleCtrlHandle, in Kernel32.dll, and I'm able to catch and handle the events, but the close event always close the process and _OnExit is never called. Any ideas for a possible solution? Is not a big problem, and shutting down the library is not fully required, but I don't like to leave libraries open. ~Sorry if I wrote something wrong, I'm not english-speaker~ Edit: The ;~D lines are debug lines, they will be deleted.
  6. Yes, the problem is in WinSetState($boxes[0], '', '@SW_HIDE'). It's just WinSetState($boxes[0], '', @SW_HIDE) Edit: The same with @SW_SHOW.
  7. I don't know much about pointers and structs, but I've seen a example of a buffer for text and it was like...you create a struct with DllStructCreate (In your case I don't know what kind of data), in the example was char[258], and then DllStructGetPointer.
  8. Hi guys, I've been working with AutoItObject and I'm curious about a thing. This code: #include 'AutoItObject.au3' _AutoItObject_Startup() Global $_oBasicObject = _AutoItObject_Create() _AutoItObject_AddProperty($_oBasicObject, 'prop', $ELSCOPE_PUBLIC, _AutoItObject_Create($_oBasicObject)) Ok, when you use _AutoItObject_Create you can copy all the properties from another object, but now he is copying himself, so the value of $_oBasicObject.prop will be another object with an exact property and is a loop or what? Then $_oBasicObject.prop.prop.prop is another object with another prop?
  9. I think he's trying to make the "Ok & Cancel" buttons with another text. But I don't know how, except setting up manually the GUI.
  10. I actually use the GuiButton UDF, so $hOk, but this still have no sense. And I like what I've read...the kind, not the type. I googled and found a lot of information, and I think is really more useful $lstFolders than $iFolders for a list (just an example). So basically, I've been working on what is on the Wiki (Best coding practices), and now I think I'm wrong and I must be a little more "flexible".
  11. I really like the ways used in that website. A really good advice and a really good way of explanation. Thanks.
  12. ¡Hi! Well, this is just a little question. ¿Do you think Hungarian Notation is a good idea? I mean, I'm a really indecisive programmer, and sometimes this makes me hard to choose stuff like a name for a function, even the most easy thing. So, personal opinion, and pros vs cons of Hungarian Notation, what do you think? ¿And what about this "http://www.autoitscript.com/wiki/Best_coding_practices#Scopes_of_Variables"?
×
×
  • Create New...