userfunction_mmdialogs

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
Celesteria
Posts: 36
Joined: Mon Jun 01, 2015 7:44 am

userfunction_mmdialogs

#1 Post by Celesteria » Wed Jun 17, 2015 4:43 am

hello there,

this is a small userfunction for adding some questions into your waypoint files. I often use the same file and dont want to edit variables by hand for every different usage. So I wrote some little functions to display a little dialog within the mm-window to set variables on startup.

Code: Select all

examples:
  local flag	= UMMD_chooseFlag ('do you want to use home runes to change class?', false)
  local num	= UMMD_chooseNumber (0, inventory:itemTotalCount (??????), 'how many ??????')
  local num	= UMMD_chooseClass (68, 'class to accept demonstration battle')
  local key	= UMMD_chooseList ({ ['l']='left, ['r']='right', ['d']='down', ['u']='up'}, 'which direction?')
It would be nice if someone has a way to handle this dialogs also ingame :)


function UMMD_chooseFlag (text, default)
------------------------------------------------------------------------------------
-- ask for yes or no
--
-- arguments:
-- text - [optional] text to display
-- default - [optional] default value (boolean)
--
-- returns:
-- true/false
------------------------------------------------------------------------------------

function UMMD_chooseNumber (min, max, text)
------------------------------------------------------------------------------------
-- ask for a number between min and max
--
-- arguments:
-- min - [required] lowvalue
-- max - [required] highvalue
-- text - [optional] text to display
--
-- returns:
-- number
------------------------------------------------------------------------------------

function UMMD_chooseList (list, text)
------------------------------------------------------------------------------------
-- ask for an entry of a given list
--
-- arguments:
-- list - [required] a list of options (option format: key="text")
-- text - [optional] text to display
--
-- returns:
-- key of the list
------------------------------------------------------------------------------------

function UMMD_chooseClass (minLevel, text)
------------------------------------------------------------------------------------
-- ask for one of the available classes of the player
--
-- arguments:
-- minLevel - [optional] level of the class must be at least this level
-- text - [optional] text to display
--
-- returns:
-- classID
------------------------------------------------------------------------------------


Version 1.2
* updated function names to fit my private policy of userfunction nameing
* updated UMMD_chooseClass to work correctly after class change
Version 1.1
* improved function chooseList to handle numeric and string keys
Version 1.0
* initial release
Attachments
userfunction_mmdialogs.lua
Version 1.2
(4.16 KiB) Downloaded 128 times
I am a botter, but no cheater. So none of my scripts ever use any of the hacks like swimhack, speedhack, wallhack...
I hope you can understand my english. Its not my native language and it has been a long time since I used it the last time :)

Celesteria
Posts: 36
Joined: Mon Jun 01, 2015 7:44 am

Re: userfunction_mmdialogs

#2 Post by Celesteria » Sat Jun 27, 2015 7:15 am

updated to version 1.2
I am a botter, but no cheater. So none of my scripts ever use any of the hacks like swimhack, speedhack, wallhack...
I hope you can understand my english. Its not my native language and it has been a long time since I used it the last time :)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests