GetIdByName userfunction (GetQuest, Skill And Buff Id)
Posted: Fri Oct 09, 2015 5:00 pm
So here's a userfunction I made. Only tested it for a bit so this is a beta release. It didn't crash client though and seems like the functions are doing what they're supposed to do.
EDIT: released v1.2 beta, it's now a lot faster than before because the search method has been changed.
Common in all functions:
- Search string is not case-sensitive.
- All functions print results as they are found in table format.
- All functions return values. If only a single match is found, it only returns the id (or system text if you're using GetSysText). If nothing is found, it returns false.
Syntax:
Limits are the Search Range limits
Exact Match can only be true or false, it defaults to true which means only exact matches will be processed, put false to process partial matches. Putting nothing or nil in the exact match argument will default to true.
GetIdByName(search string, exact match, first lower limit, first upper limit, second lower limit, second upper limit)
- By default, it has no range limits so it searches the whole range but it is limited to only process stuff that has Sys(digits)_name as their system text.
Examples:
GetIdByName("dragon") -- will not find any match, there's plenty of dragons in game but there's not one that has only the name dragon.
GetIdByName("dragon", false) -- finds 593 matches.
GetIdByName("dragon", false, 100000, 120000) -- matches found cut to 58 as the range has been cut down considerably.
GetIdByName("dragon", false, 100000, 120000, 230000, 300000) -- matches found back up to 121 with the added search range.
GetQuestId(search string, quest type filter, exact match, first lower limit, first upper limit, second lower limit, second upper limit)
- Quest type argument should be either "normal", "daily" or "public". Anything other than those will default to "all", in which case the bot will return every quest type.
- Prints matches in table format. The table includes the Level and the Type apart from the Name and Id.
- By default, it only processes ids between 420000 and 430000 coz that's where quests are, but you can override it anytime through the function's arguments. You can change the default values (420000 - 430000) permanently in the user options section of the file.
Examples:
GetQuestId("juice") -- will not find any match
GetQuestId("juice delivery") -- prints and returns the id 422917
GetQuestId("juice", nil, false) -- nil defaults to "all" and we only searched for partial match. Will return 5 matches displaying all quest types and all quests with juice in its name.
GetQuestId("juice", "daily", false) -- matches found cut to 1 as there is only 1 quest that has juice in its name and is a daily.
GetSkillId(search string, exact match, first lower limit, first upper limit, second lower limit, second upper limit)
- Prints matches in table format. The table includes the CastTime and the Range apart from the Name and Id.
- By default, it only processes ids between 490000 and 499999 coz (I think) that's where all the skills are, but you can override it anytime through the function's arguments. You can also change the default values (490000 - 499999) permanently in the user options section of the file.
For Examples, see GetIdByName, this function is exactly like GetIdByName except that it has a built-in range filter.
GetBuffId(search string, exact match, first lower limit, first upper limit, second lower limit, second upper limit)
- By default, it only processes ids in two ranges between 500000 and 500999 and 620000 and 630000 coz (I think) that's where all the buffs are, but you can override it anytime through the function's arguments. You can also change the default values permanently in the user options section of the file.
Same as GetSkillId. For Examples, see GetIdByName, this function is exactly like GetIdByName except that it has a built-in range filter.
GetSysText(search string, exact match)
- This is essentially the most powerful search, it has no limitations whatsoever so it processes every text it can read. This means you can also use GetSysText to search for skills, quests, buffs etc.
Examples:
GetSysText("regional event") -- will not find any match
GetSysText("regional event", false) -- finds 5 matches
GetSysText("regional event now restarting") -- no matches as it is missing a "!" to be exact
GetSysText("regional event now restarting", false) -- prints and returns SC_ZONE_PE_3TH_ST1START
GetSysText("regional event now restarting!") -- prints and returns SC_ZONE_PE_3TH_ST1START
EDIT: released v1.2 beta, it's now a lot faster than before because the search method has been changed.
Common in all functions:
- Search string is not case-sensitive.
- All functions print results as they are found in table format.
- All functions return values. If only a single match is found, it only returns the id (or system text if you're using GetSysText). If nothing is found, it returns false.
Syntax:
Limits are the Search Range limits
Exact Match can only be true or false, it defaults to true which means only exact matches will be processed, put false to process partial matches. Putting nothing or nil in the exact match argument will default to true.
GetIdByName(search string, exact match, first lower limit, first upper limit, second lower limit, second upper limit)
- By default, it has no range limits so it searches the whole range but it is limited to only process stuff that has Sys(digits)_name as their system text.
Examples:
GetIdByName("dragon") -- will not find any match, there's plenty of dragons in game but there's not one that has only the name dragon.
GetIdByName("dragon", false) -- finds 593 matches.
GetIdByName("dragon", false, 100000, 120000) -- matches found cut to 58 as the range has been cut down considerably.
GetIdByName("dragon", false, 100000, 120000, 230000, 300000) -- matches found back up to 121 with the added search range.
GetQuestId(search string, quest type filter, exact match, first lower limit, first upper limit, second lower limit, second upper limit)
- Quest type argument should be either "normal", "daily" or "public". Anything other than those will default to "all", in which case the bot will return every quest type.
- Prints matches in table format. The table includes the Level and the Type apart from the Name and Id.
- By default, it only processes ids between 420000 and 430000 coz that's where quests are, but you can override it anytime through the function's arguments. You can change the default values (420000 - 430000) permanently in the user options section of the file.
Examples:
GetQuestId("juice") -- will not find any match
GetQuestId("juice delivery") -- prints and returns the id 422917
GetQuestId("juice", nil, false) -- nil defaults to "all" and we only searched for partial match. Will return 5 matches displaying all quest types and all quests with juice in its name.
GetQuestId("juice", "daily", false) -- matches found cut to 1 as there is only 1 quest that has juice in its name and is a daily.
GetSkillId(search string, exact match, first lower limit, first upper limit, second lower limit, second upper limit)
- Prints matches in table format. The table includes the CastTime and the Range apart from the Name and Id.
- By default, it only processes ids between 490000 and 499999 coz (I think) that's where all the skills are, but you can override it anytime through the function's arguments. You can also change the default values (490000 - 499999) permanently in the user options section of the file.
For Examples, see GetIdByName, this function is exactly like GetIdByName except that it has a built-in range filter.
GetBuffId(search string, exact match, first lower limit, first upper limit, second lower limit, second upper limit)
- By default, it only processes ids in two ranges between 500000 and 500999 and 620000 and 630000 coz (I think) that's where all the buffs are, but you can override it anytime through the function's arguments. You can also change the default values permanently in the user options section of the file.
Same as GetSkillId. For Examples, see GetIdByName, this function is exactly like GetIdByName except that it has a built-in range filter.
GetSysText(search string, exact match)
- This is essentially the most powerful search, it has no limitations whatsoever so it processes every text it can read. This means you can also use GetSysText to search for skills, quests, buffs etc.
Examples:
GetSysText("regional event") -- will not find any match
GetSysText("regional event", false) -- finds 5 matches
GetSysText("regional event now restarting") -- no matches as it is missing a "!" to be exact
GetSysText("regional event now restarting", false) -- prints and returns SC_ZONE_PE_3TH_ST1START
GetSysText("regional event now restarting!") -- prints and returns SC_ZONE_PE_3TH_ST1START