Guest User

Quadzerker Omniscient steal

a guest
Jul 18th, 2020
20
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. save = savestate.create()
  2. savestate.save(save)
  3. seen = false
  4. reloads = -1
  5. clears = 0
  6. seen_count = 0
  7. reload_time = os.clock()
  8. potions = 0
  9. have_potion = false
  10.  
  11. function reload(reason)
  12.    vba.print(reason)
  13.    reloads = reloads + 1
  14.    reload_time = os.clock()
  15.    savestate.load(save)
  16.    rng = math.random(2400)
  17.    while(rng > 0) do
  18.      vba.message("R: " .. reloads  .. " S: " .. seen_count .. " C: " .. clears .. " P: " .. potions)
  19.      vba.frameadvance()
  20.      rng = rng - 1
  21.    end
  22.    i = 0
  23.    while(i < 200) do
  24.      joypad.set(1, {up=true})
  25.      vba.message("R: " .. reloads  .. " S: " .. seen_count .. " C: " .. clears .. " P: " .. potions)
  26.      vba.frameadvance()
  27.      i = i+1
  28.    end
  29. end
  30.  
  31. reload("Start")
  32.  
  33. while true do
  34.    vba.message("R: " .. reloads  .. " S: " .. seen_count .. " C: " .. clears .. " P: " .. potions)
  35.    if(memory.readbyte(0x0201C360) == 224) then
  36.       if(have_potion == false) then
  37.         potions = potions + 1
  38.         have_potion = true
  39.       end
  40.       seen = false
  41.    end
  42.    if(memory.readbyte(0x0201C360) == 197 and seen == false) then
  43.       vba.print("Seen it!")
  44.       vba.print(seen_count)
  45.       seen = true
  46.       have_potion = false
  47.       seen_count = seen_count + 1
  48.    end
  49.    if(memory.readbyte(0x0201C360) == 0) then
  50.       seen = false
  51.       have_potion = false
  52.    end
  53.    if(memory.readwordsigned(0x0201F056) == 16999 and memory.readwordsigned(0x0201F054) == 0) then
  54.      clears = clears + 1
  55.      vba.print("Cleared!")
  56.      vba.print(clears)
  57.      if(seen == true) then
  58.        vba.print("GOT IT!")
  59.        break
  60.      end
  61.      if(seen == false) then
  62.        reload("Didn't steal the thing")
  63.      end
  64.    end
  65.    if(os.clock() - reload_time > 90) then
  66.       reload("Timed out")
  67.    end
  68.    vba.frameadvance()
  69. end
  70.  
  71. vba.print("Done")
RAW Paste Data