
TrashBoat
Active Members-
Posts
50 -
Joined
-
Last visited
Everything posted by TrashBoat
-
@Dionysis Yeah im learning c++ and got that habit from there, but it seems to work anyway.
-
Oh it makes sense, i get it now because i am deleting entries my array is getting smaller and the for loop will fail because it wont have those entries at the bottom anymore. Thanks for the help.
-
Im trying to iterate through a 2d array created by ProcessList() function that returns a 2d array containing names and pid's, i wanted to filter through the names and delete entries that have "svchost.exe" and this is how i did it Func _Sanitize($array) For $x = 1 To UBound($array) - 1 ConsoleWrite($array[$x][0] & @CRLF) If $array[$x][0] == "svchost.exe" Then _ArrayDelete($array, $x) EndIf Next EndFunc ;==>_Sanitize And i get this error message What is wrong?
-
Gettin plain text from website - (Moved)
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
$data = BinaryToString(InetRead($webpage)) I accidentally passed the IE object instead of the link my bad. Thanks it worked! -
Gettin plain text from website - (Moved)
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
Nvm ive found it the point is i dont want to download it i just want the raw data. -
Gettin plain text from website - (Moved)
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
I have not? I cant find "INetRead" in the function list. -
Gettin plain text from website - (Moved)
TrashBoat posted a topic in AutoIt General Help and Support
Im having trouble getting raw data from this api website, instead it prompts me to download the whole .json file. Can i somehow just read the webpage and just store the data without downloading it? #include <IE.au3> $src = "https://rsbuddy.com/exchange/summary.json" $oIE = _IECreate($src,0,1,1,0) $data = _IEDocReadHTML($oIE) MsgBox(0,0,$data) _IEQuit($oIE) -
Help with setting GUI color
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
Ok so it struck me that i just needed to update the gui so i put that into the function and called it then i changed the color and guess what it worked! _drawc1() Func _drawc1() #Region crosshair1 Global $hBarGUI = GUICreate("", 1, 1, 91, 188, 0x80000000, 0x08000080) GUICtrlCreateLabel("", 1, 1, 1, 1) GUICtrlSetBkColor(-1, $color) GUISetBkColor($color, $hBarGUI) WinSetTrans($hBarGUI, '', 0) WinSetState($hBarGUI, '', @SW_SHOWNOACTIVATE) WinMove($hBarGUI, '', 0, -19) WinSetTrans($hBarGUI, '', 254) WinSetOnTop($hBarGUI, "", 1) _WinAPI_SetWindowLong($hBarGUI, $GWL_EXSTYLE, BitOR(_WinAPI_GetWindowLong($hBarGUI, $GWL_EXSTYLE), $WS_EX_TRANSPARENT)) #EndRegion crosshair1 EndFunc ;call this func then the color has been set to redraw the gui, noice -
Help with setting GUI color
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
For anyone wondering if the picture does work: Well yeah and no at the same time, the transparent background is not working. -
Help with setting GUI color
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
@careca The problem is i dont know GDI so i just wanted to make something simple that works but has some flaws, going to try to draw a image instead if that does not work then ill read about gdi. -
Help with setting GUI color
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
Maybe there is a simpler way of drawing just the GUI part like that , if there is post it here. Thanks -
Help with setting GUI color
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
Tried moving the gui position out of the screen bounds to force it to update the color still didin't change -
Help with setting GUI color
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
Here u go, the entire script cause im lazy. -
Help with setting GUI color
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
and why cant i remove that @swa -
After i create my GUI i cant set the color anymore. help? $hBarGUI1 = GUICreate("", 50, 1, 91, 188, 0x80000000, 0x08000080) $g = GUICtrlCreateLabel("", 1, 1, 1, 1) GUICtrlSetBkColor(-1, $color) GUISetBkColor($color, $hBarGUI1) WinSetTrans($hBarGUI1, '', 0) WinSetState($hBarGUI1, '', @SW_SHOWNOACTIVATE) WinMove($hBarGUI1, '', -1, -1) WinSetTrans($hBarGUI1, '', 254) WinSetOnTop($hBarGUI1, "", 1) I see that my problem has to do something with WinSetState but have no clue how to fix it already tried to set it to @SW_UNLOCK and @SW_SHOWNORMAL. @swa
-
I need help figuring some math out
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
Yeah I've just decided to hard code so if the float is smaller than 0.3 or bigger than -0.3 (thanks to @BrewManNH for the rounding up numbers snippet) reset the velocity to 0 $horizontalVelocity = Int($horizontalVelocity * 100) / 100 ; gives 2 digits after the decimal point If $horizontalVelocity < 0.3 Then $horizontalVelocity = 0 $horizontalVelocity = Int($horizontalVelocity * 100) / 100 ; gives 2 digits after the decimal point If $horizontalVelocity > -0.3 Then $horizontalVelocity = 0 -
So i have been working on this 2d physics game and added some physics to it but got stuck on this problem that the character ( the cube ) is sliding all the time but it should not do that because of this friction function: If $horizontalVelocity > 0 Then If $inAir Then $currFriction = $airFriction $horizontalVelocity -= $currFriction $birbX += $horizontalVelocity EndIf this line "$horizontalVelocity -= $currFriction" should nullify the velocity to 0 but it stays somewhere in 0.09. How do i fix this? Here's the game's source code and what i have done so far: Now i don't expect you reading my nasty code and understanding what it does but any help would be appreciated. Edit: I guess the problem is solved, i have updated the source code if anyone needs it.
-
How did i not think of that. And does me not closing the dll result in memory loss or smth?
-
So I've made this script that detects how long i have held down my left mouse button for and stores the information in an array and then sorts its using _ArraySort but the output is half sorted half broken. Here's my script: HotKeySet("{F1}","_exit") #include <Misc.au3> #include <Timers.au3> #include <Array.au3> Local $dll = DllOpen("user32.dll") $on = False Global $array[0] While(1) If _IsPressed(01,$dll) Then $timer = _Timer_Init() While _IsPressed(01,$dll) Sleep(1) WEnd $time = _Timer_Diff($timer) _ArrayAdd($array,"Time: " & Floor($time) & " ms") ;~ ConsoleWrite("Time: " & Floor($time) & " ms" & @CRLF) EndIf Sleep(50) WEnd Func _exit() _ArraySort($array) _ArrayDisplay($array) Exit EndFunc And the output: See how its not sorted? What is the problem here?
-
Yeah my input had broken english, should've payed more attention
-
@Deye it seems to have failed on "fourthousandsevenhundredfourtysix" and gave 4706
-
Add spaces between string elements
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
yeah ive added them myself no need $s = StringRegExpReplace($s, "(?i)(ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen)", "\1 ") -
Add spaces between string elements
TrashBoat replied to TrashBoat's topic in AutoIt General Help and Support
ughh.. what are those (?i) i want to know i understand the (?!y) and (?!ty) , and thanks it works perfectly! -
hey i would like to know if its possible to take a string like this $string = "onethousandninehundredeightyfive" and convert it into: $string = "one thousand nine hundred eighty five" i have something going on here but its no use $string = "onethousandninehundredeightyfive" Global $array[9] = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'] Global $array1[19] = ['onethousand', 'twothousand', 'threethousand', 'fourthousand', 'fivethousand', 'sixthousand', 'seventhousand', 'eightthousand', 'ninethousand','tenthousand','hundred', 'twohundred', 'threehundred', 'fourhundred', 'fivehundred', 'sixhundred', 'sevenhundred', 'eighthundred', 'ninehundred'] MsgBox(0, 0, AddSpaces($string)) Func AddSpaces($string) Local $finalStr $length = StringLen($string) For $x = 0 To $length Local $trim = StringTrimRight($string, $x) For $h = 0 To 18 If $trim = $array1[$h] Then $finalStr = $finalStr & " " & $trim $string = StringTrimLeft($string, $h) $length = StringLen($string) EndIf Next For $z = 0 To 8 If $trim = $array[$z] Then $finalStr = $finalStr & " " & $trim $string = StringTrimLeft($string, $z) $length = StringLen($string) EndIf Next Next Return $finalStr EndFunc ;==>AddSpaces