Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Begin x1DenCurMtS
- ; in ANY programming language, identifiers should start with a letter and only include a..z, A..Z letters, 0..9 digits, underscore
- Short count
- ; Morrowind scripting is a Basic-like language,
- ; a function ( e.g. one starting with Get ) needs to be used by a variable,
- ; a procedure ( e.g. RemoveItem ) does not
- ; RemoveItem procedure does not work with variables
- ; so you need to do 1 move per frame or use a while loop.
- ; 1 move per frame will be slow, while could apparently freeze the screen while running.
- ; using multiple While loops is usually the preferred method
- if ( MenuMode )
- else
- return
- endif
- ; Morrowind scripting parser is very delicate, it easily breaks at runtime
- ; if you do not use proper spacing. Also better not use commas.
- Set count to ( GetItemCount "x1totem_of_will_masser" )
- ; fastest loop would be using binary steps e.g.
- while ( count >= 16 )
- RemoveItem "x1totem_of_will_masser" 16
- AddItem "x1totem_of_will" 16
- ; decreasing the local variable is faster than calling the function
- set count to ( count - 16 )
- endwhile
- while ( count >= 8 )
- RemoveItem "x1totem_of_will_masser" 8
- AddItem "x1totem_of_will" 8
- set count to ( count - 8 )
- endwhile
- while ( count >= 4 )
- RemoveItem "x1totem_of_will_masser" 4
- AddItem "x1totem_of_will" 4
- set count to ( count - 4 )
- endwhile
- while ( count >= 2 )
- RemoveItem "x1totem_of_will_masser" 2
- AddItem "x1totem_of_will" 2
- set count to ( count - 2 )
- endwhile
- if ( count == 1 ) ; last one
- RemoveItem "x1totem_of_will_masser" 1
- AddItem "x1totem_of_will" 1
- endif
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement