Jump to content

TrashBoat

Active Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by TrashBoat

  1. @Dionysis Yeah im learning c++ and got that habit from there, but it seems to work anyway.
  2. 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.
  3. 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?
  4. $data = BinaryToString(InetRead($webpage)) I accidentally passed the IE object instead of the link my bad. Thanks it worked!
  5. Nvm ive found it the point is i dont want to download it i just want the raw data.
  6. I have not? I cant find "INetRead" in the function list.
  7. 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)
  8. 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
  9. For anyone wondering if the picture does work: Well yeah and no at the same time, the transparent background is not working.
  10. @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.
  11. Maybe there is a simpler way of drawing just the GUI part like that , if there is post it here. Thanks
  12. Tried moving the gui position out of the screen bounds to force it to update the color still didin't change
  13. Here u go, the entire script cause im lazy.
  14. and why cant i remove that @swa
  15. 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
  16. 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
  17. 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.
  18. So Im trying to make a simple 2d game and make some sort of collision detection so why not to make a 2 dimensional array but i have no clue how to write it in multiple lines Global $map[5,5] = [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0 _ [0,0,0,0,0] something like this but it doesn't work
  19. How did i not think of that. And does me not closing the dll result in memory loss or smth?
  20. 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?
  21. Yeah my input had broken english, should've payed more attention
  22. @Deye it seems to have failed on "fourthousandsevenhundredfourtysix" and gave 4706
  23. yeah ive added them myself no need $s = StringRegExpReplace($s, "(?i)(ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|eighteen|nineteen)", "\1 ")
  24. ughh.. what are those (?i) i want to know i understand the (?!y) and (?!ty) , and thanks it works perfectly!
  25. 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
×
×
  • Create New...