Advertisement
maziari

KAR - Tempura Lua

May 2nd, 2025
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. function onScriptStart()
  2. end
  3.  
  4. function onScriptCancel()
  5.     MsgBox("Script ended.")
  6. end
  7.  
  8. function onScriptUpdate()
  9.     TempuraCount = 0
  10.     text = ""
  11.  
  12.     p_ItemList = ReadValue32(0x812BBC54)
  13.     --p_ItemList = ReadValue32(0x812AB108)
  14.    
  15.     Addr = p_ItemList
  16.    
  17.     while Addr ~= 0 do
  18.         if Addr == 0 then
  19.             goto continue
  20.         end
  21.         p_Next = ReadValue32(Addr+8)
  22.         p_Prev = ReadValue32(Addr+12)
  23.         p_Item = ReadValue32(Addr+44)
  24.         text = text..string.format("\n Addr : %08X, Next : %08X, Prev : %08X, Item : %08X, ", Addr, p_Next, p_Prev, p_Item)
  25.  
  26.         if p_Item ~= 0 then
  27.             ItemNum = ReadValue32(p_Item+28)
  28.         --ItemX = ReadValueFloat(p_Item+220)
  29.         --ItemY = ReadValueFloat(p_Item+224)
  30.         --ItemZ = ReadValueFloat(p_Item+228)
  31.  
  32.             --text = text..string.format("%02X, %.3f, %.3f, %.3f", ItemNum, ItemX, ItemY, ItemZ)
  33.             text = text..string.format("%02X", ItemNum)
  34.  
  35.             if ItemNum == 0x31 then
  36.                 text = text.." !!TEMPURA!!"
  37.                 TempuraCount = TempuraCount + 1
  38.             end
  39.         end
  40.  
  41.         Addr = p_Next
  42.     end
  43.  
  44.     ::continue::
  45.    
  46.     text=text..string.format("\nTEMPURA : %d", TempuraCount)
  47.  
  48.     SetScreenText(text)
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement