Advertisement
Doug4347

transporter.ahk

Dec 5th, 2022 (edited)
729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  2. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  3.  
  4. SlotCount := 32
  5. MenuSelection := 3
  6.  
  7. XButton1::
  8.     pickedup := !pickedup
  9.     downs := MenuSelection-1
  10.     If pickedup {
  11.         Send, t^a/crate pickup`n
  12.         sleep, 500
  13.         if (MenuSelection > 1)
  14.         Send, {down %downs%}
  15.         Send, {down 2}`n
  16.     } else {
  17.         Send, t^a/crate putdown`n
  18.     }
  19. Return
  20.  
  21. XButton2::
  22.     pickedup := !pickedup
  23. Return
  24.  
  25. !1::
  26.     unloading := true
  27.     SlotNum := 1
  28.     While (A_Index < SlotCount+1 and unloading)
  29.     {
  30.         Send, t^a/crate pickup`n
  31.         sleep, 500
  32.         if (SlotNum = 1) {
  33.             Send, {enter}
  34.         } else {
  35.             if (slotNum = 11) {
  36.                 Send, {down 10}
  37.                 Send, {enter}
  38.                 sleep, 1000
  39.                 Send, {enter}
  40.                 slotNum = 1
  41.             } else {
  42.                 downs := SlotNum-1
  43.                 Send, {down %downs%}{enter}
  44.             }
  45.         }
  46.        
  47.         SlotNum += 1
  48.         sleep, 2000
  49.         send, t^a/crate putdown`n
  50.         sleep, 2000
  51.     }
  52.     unloading := false
  53. Return
  54.  
  55. #if unloading
  56.     1:: unloading := false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement