Jump to content

Vindicator209

Active Members
  • Posts

    615
  • Joined

  • Last visited

Everything posted by Vindicator209

  1. How could I draw a rectangle on the screen, not in a gui window? I imagine it might have something using GDIPlus but I can't find a relevant function. Thanks. Edit: I apologize, I found my answer only a few topics down. WinAPI
  2. That works beautifully! Thanks!
  3. Hello, I am trying to create a script to replace many .png files with a blank image of the same dimensions. I guessed I would be using GDIPlus, but I'm not sure how to create a blank image using it. Here is my unfinished attempt: #include <Array.au3> #include <File.au3> #include <GDIPlus.au3> _GDIPlus_Startup() $folders = _FileListToArray(@ScriptDir,"*",2) For $i = 1 to $folders[0] $files = _FileListToArray(@ScriptDir & "\" & $folders[$i],"*.png") For $k = 1 to $files[0] $image = _GDIPlus_ImageLoadFromFile(@ScriptDir & "\" & $folders[$i] & "\" & $files[$i]) $height = _GDIPlus_ImageGetWidth($image) $width = _GDIPlus_ImageGetHeight($image) _GDIPlus_ImageDispose($image) FileDelete(@ScriptDir & "\" & $folders[$i] & "\" & $files[$i]) ;create blank image of height and width $newimage = "Blank Image Here" $CLSID = _GDIPlus_EncodersGetCLSID ("PNG") _GDIPlus_ImageSaveToFileEx($newimage,@ScriptDir & "\" & $folders[$i] & "\" & $files[$i],$CLSID) Next Next _GDIPlus_Shutdown() How would I create a blank image using the GDIPlus UDF to be saved using _ImageSaveToFileEx? Thanks
  4. Did you include it in your script? #include <FF.au3>
  5. Hi, I was wondering how I could pass variables to a php script. At the moment, I'm automating a form submission by using the _IE functions, but I feel it would be much more efficient if I could directly send data to the php script that the form calls. I tried _IENavigate(IE,"POST.php?name=NAME&class=CLASS") but it did not seem to work. The form code is: <form name='form' id='form' method='POST' action='POST.php'> <input type='text' name='name' size='20' value="" /> <input type='text' name='class' size='30' value="" /> <input type='submit' name='submit' value='submit'/> Thanks alot.
  6. Sorry... This is more of a math question, really. I made a simple little 3d box that you can move around in, I intend on being able to create objects and stuff in it, but I put that off because I don't know how to do point rotations. I want to transform/rotate a set of points, given the center and the rotation angle. I did some googling, and I came up with lots of "3D Rotation Matrix" stuff but with a geometry-level education, I'm not understanding it. Can anyone give me a tip? Heres my code, incase you want to know what it's for. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <Misc.au3> Global $w = 1000 Global $h = 800 Global $d = 800 Global $x_center = Round($w/2,0) Global $y_center = Round($h/2,0) $dll = DllOpen("User32.dll") $Form1 = GUICreate("Form1", $w+100, $h + 100, -1, -1) $Stats_1 = GUICtrlCreateLabel("",0,100,200,200) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUISetState(@SW_SHOW) Dim $ava[1][3] $ava[0][0] = 0 $ava[0][1] = 0 $ava[0][2] = 0 $f_skip = 2 ;frame skip $fc= 0 #cs ;Draw Grid For $z_x = 0 to $w For $z_y = 2 to 800 For $z_z = 0 to 150 drawPoint($z_x,$z_y,$z_z) $z_z += 50 Next $z_y += 50 Next $z_x += 50 Next #ce ;Draw Cube drawPoint(0,0,0) drawPoint($w,0,0) drawPoint($w,$h,0) drawPoint(0,$h,0) drawPoint(0,0,$d) drawPoint($w,0,$d) drawPoint($w,$h,$d) drawPoint(0,$h,$d) $x_vel = 0 $y_vel = 0 $z_vel = 0 $lastpoint = drawPoint(0,0,0) $posChange = False While 1 calcInput() calcPhys() $nMsg = GUIGetMsg() $Stats = "X: " & Round( $ava[0][0] , 2) $Stats &= @CRLF & "Y: " & Round( $ava[0][1] , 2) $Stats &= @CRLF & "Z: " & Round( $ava[0][2] , 2) $Stats &= @CRLF & "Xvel: " & Round( $x_vel , 2) $Stats &= @CRLF & "Yvel: " & Round( $y_vel , 2) $Stats &= @CRLF & "Zvel: " & Round( $z_vel , 2) GUICtrlSetData($Stats_1,$Stats) Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GUISetState(@SW_SHOW) Func drawObject($obj) For $i = 0 to UBound($obj) - 1 $obj[$i][0] = drawPoint($obj[$i][1],$obj[$i][2],$obj[$i][3]) Next Return $obj EndFunc Func drawPoint($x,$y,$z) $y = ($h-$y) $x_dist = ($x_center - $x) / 10 $y_dist = ($y_center - $y) / 10 $point = GUICtrlCreateLabel("+", $x + ($x_dist * ($z/100)), $y + ($y_dist * ($z/100)), 50, 50,$SS_CENTER) $size = 50 - ((32 / $d) * $z) If $size < 1 Then $size = 1 GUICtrlSetFont(-1, $size) $color = Round( ($z / $d) * 99, 0 ) If $color > 99 then $color = 99 If $color < 0 Then $color = 0 GUICtrlSetColor(-1, "0x00" & $color & "00") GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) Return $point EndFunc Func calcPhys() $ava[0][0] += $x_vel $ava[0][1] += $y_vel $ava[0][2] += $z_vel If $x_vel > 1 Then $x_vel -= 0.5 ElseIf $x_vel < -1 Then $x_vel += 0.5 Else $x_vel = 0 EndIf If $z_vel > 1 Then $z_vel -= 0.5 ElseIf $z_vel < -1 Then $z_vel += 0.5 Else $z_vel = 0 EndIf If $ava[0][0] < 0 Then $ava[0][0] = 0 $x_vel *= -2/3 ElseIf $ava[0][0] > $w Then $ava[0][0] = $w $x_vel *= -2/3 EndIf If $ava[0][1] < 0 Then $ava[0][1] = 0 If Abs($y_vel) < 1 Then $y_vel = 0 Else $y_vel *= -2/3 EndIf ElseIf $ava[0][1] > $h Then $ava[0][1] = $h $y_vel *= -1 EndIf If $ava[0][2] < 0 Then $ava[0][2] = 0 $z_vel *= -2/3 ElseIf $ava[0][2] > $d Then $ava[0][2] = $d $z_vel *= -2/3 EndIf If $fc = $f_skip Then GUICtrlDelete($lastpoint) $lastpoint = drawPoint($ava[0][0],$ava[0][1],$ava[0][2]) $fc = 0 Else $fc +=1 EndIf $y_vel -= 2 EndFunc Func calcInput() If _IsPressed(25,$dll) Then $x_vel -= 2 EndIf If _IsPressed(27,$dll) Then $x_vel += 2 EndIf If _IsPressed(26,$dll) Then $z_vel += 2 EndIf If _IsPressed(28,$dll) Then $z_vel -= 2 EndIf If _IsPressed(20,$dll) Then $y_vel += 6 EndIf EndFunc
  7. I'm planning to make a little UI for some of my programs, but I don't want to go extracting the ICO files everytime I add a new program. Is there any way I can get the icon from another file and use it in my script?
  8. Well, first off ProcessClose is a command to close the process, not to check if it's closed, so that line won't help you. You'll want to check if the process is still open, instead: ProcessExists("Game") And loop it, so when the game is closed, autoit will know that it doesn't exist anymore, which is the same thing. Then you can carry out whatever functions you want from there, An example of waiting for a game to close: Do Sleep(1000) Until Not(ProcessExists("Game"))
  9. Probably. Use the autoit window tool to find the name of the control that displays the percentage information, and get it using ControlGetText .
  10. So yeah... i'm trying to make a script that gives me medians... but I can't sort a list of numbers because it will put multiple-digit numbers in the wrong place. For example, I put in 1,2,3,10,22,31 in _ArraySort and it gives me 1,10,2,22,3,31 Any way I can put these numbers in order of least to greatest?
  11. Ah yeah, I remember that now. Problem is, I can't get it to come up in the script.. I ran it from scite about 30 times without it giving the error... But I know its an array error so atleast I know where to look. Thanks.
  12. I'm pretty sure there's already a detailed post on the Line -1 error, but search doesn't like me, or maybe I'm just blind... Either way, can anyone tell me what causes this? It only occurs when running my program for the first time after a reboot.
  13. I have an embedded IE object in my GUI, and when links are clicked they open in IE. Is there anyway to stop that, and open it in whatever the user's default browser instead?
  14. Oh, wow, I thought I ruled that out by making it generate numbers within a larger range Thanks alot. That hurt my brain for a while. I couldn't understand how I mess up on such a small script...
  15. You probably want _IEFormElementGetCollection. It gets a list of all the elements in a form, by number. Look in the html and count how many elements are before the one you want (the username box, probably) and that will probably be the number you need. If that doesn't work you'll have to try trial and error... heres a little excerpt from a chat program I made: $OFORM = _IEFormGetObjByName($LOGINS, "Login") $NAME = _IEFormElementGetCollection($OFORM, 0) _IEFormElementSetValue($NAME, $LOGINNAME) Search "_IEFormElementGetCollection " in the help file
  16. It's an example
  17. Okay so I created a simple script to sort out a list of numbers generated by itself. However, i find that the list of results has several missing numbers. Why is this? I set up msg boxes and stuff everywhere to see if it's doing something wrong, but it's not... #include <Array.au3> Dim $d[105] Dim $fin[105] For $i = 1 To 100 $d[$i] = Random(0,1000,1) Next For $k = 1 To 100 $max = 0 $CVAR = $d[$k] For $i = 1 To 100 If $CVAR > $d[$i] Then $max += 1 Next $fin[$max + 1] = $CVAR Next _ArrayDisplay($fin) Thanks
  18. Chr(Random(Asc("A"), Asc("Z"), 1)) is that what you are looking for?
  19. no, it's not the column width, the column is wide enough to fill an entire web URL in.
  20. Okay, I got this much: #Include <GuiListView.au3> $hWnd = ControlGetHandle("Default.jcd - FlashGet", "", "SysListView321") For $i = 0 To 1000 _GUICtrlListView_SetItemText($hWnd, $i, "Test") Next It can change all the values in the first column to "Test" but I can't get it to change anything other than that. I did the For...Next loop to see if the other cells were different indexes.. nope. Thanks for the help... i didn't see SetItemText lol EDIT: Nevermind, I got it, it was the subitem... I gnored that since it was AFTER the text. Thanks for all the help! EDIT: Okay... it only wants to put in 3 characters for some reason, like, instead of actually setting it to "test" it only shows up as "tes" Any idea?
  21. How do I edit an existing cell though? I can return stuff already there, or make new boxes, but I can't find something that edits it: $Data = ControlListView("Default.jcd - FlashGet", "", "SysListView321","GetItemCount")
  22. Hey, I want to change a few entries on a class type "SysListView32" on an external program. Any chance you could tell me how editing lists work? I was just going to use ControlSetText
  23. Is there any way I can read individual pixel colors in a .bmp file? Side question: How do I make my program do different functions if launched with command line parameters?
  24. Hmm, so I'm trying to make my script login to a website, but I don't know how to send multiple things, since this function only has 1 parameter for data, and I try using an array but it didn't quite work out: $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") ;Login("SRbot","1234bot") Dim $var[2][2] $var[0][0] = "loginname" $var[0][1] = "SRBot" $var[1][0] = "password" $var[1][1] = "abc123" _HTTPRequest($oHTTP, "POST", "http://www.soulraver.net/login.php",$var) HotKeySet("{INS}","Get") While 1 Sleep(1000) WEnd Func _HTTPRequest($oHTTP, $oMethod, $oURL, $oData = "") $oHTTP.Open($oMethod, $oURL, False) If $oMethod = "POST" Then $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.Send($oData) Return $oHTTP.ResponseText EndFunc Func Get() MsgBox(0,"",_HTTPRequest($oHTTP, "GET", "http://www.soulraver.net/newchat.php") & @CRLF) EndFunc Then my friend who already did this in perl told me to try this(which doesn't work): $var["loginname"] = "SRBot" $var["password"] = "123abc" _HTTPRequest($oHTTP, "POST", "http://www.soulraver.net/login.php",$var) I have to send both the username and password at the same time, along with which is which... but i dont know how I would do that... Any help? Thanks. I didn't want to use the other thread cause this is a different problem and such..yeah...
  25. Hey, awesome, I got 1 step closer, I'm getting something. But I think my answer lies in the requestheader: application/x-www-form-urlencoded EDIT: nevermind, that's not the problem. How do I send post? I guess it's just $oHTTP.Send("loginname","namehere")? err... okay, nevermind, using AzKay's funtion thingy, how do i do this, it only has one parameter for data so how do I tell it that what I'm sending is a loginname?
×
×
  • Create New...