User Tools

Site Tools


developer_center:developer_editor:script:valuegroup

ValueGroup API class

Methods in ValueGroup for use in scripts.

↵ Return to the main script page


API list

Class:apiName(parameters) Returns Description
Valuegroup:getAllGroupItem(vartype:VARTYPE, libname:string, playerid:number) ErrorCode.OK, ret:table Get all the values in any variable group
Valuegroup:insertInGroupByName(vartype:VARTYPE, libvarid:string, value:number, playerid:number) ErrorCode.OK Add any value to any group, and insert it at the last position of the group
Valuegroup:removeValueIndexByName(vartype:VARTYPE, libvarid:string, indx:number, playerid:number) ErrorCode.OK Sets the value of the specified index on the variable group to nil
Valuegroup:removeValueByName(vartype:VARTYPE, libvarid:string, value:number, playerid:number) ErrorCode.OK Sets any indexes on the variable group containing the specified value to nil
Valuegroup:clearGroupByName(vartype:VARTYPE, libvarid:string, playerid:number) ErrorCode.OK Clears all indexes of the specified variable group
Valuegroup:getGrouplengthByName(vartype:VARTYPE, libvarid:string, playerid:number) ErrorCode.OK, number:number Get the length of the specified variable group
Valuegroup:getValueNoByName(vartype:VARTYPE, libvarid:string, indx:number, playerid:number) ErrorCode.OK, libvarid:number Get the value of the specified index in the variable group
Valuegroup:setValueNoByName(vartype:VARTYPE, libvarid:string, indx:number, value:number, playerid:number) ErrorCode.OK Set the value of the specified index in the variable group
Valuegroup:getRandomValueByName(vartype:VARTYPE, libvarid:string) ErrorCode.OK, value:number Picks a random value in the specified variable group and returns the chosen value
Valuegroup:insertValueByName(vartype:VARTYPE, libvarid:string, no:number, value:number, playerid:number) ErrorCode.OK Insert any value at any numbered position in the specified variable group
Valuegroup:deleteNoByName(vartype:VARTYPE, libvarid:string, no:number, playerid:number) ErrorCode.OK Clear the value of the specified position from the variable group
Valuegroup:deleteValueByName(vartype:VARTYPE, libvarid:string, val:number, playerid:number) ErrorCode.OK Clears any exact references of the specified value from the variable group
Valuegroup:addGroupByName(vartype:VARTYPE, libvarid:string, libvarid2:string, playerid1:number, playerid2:number) ErrorCode.OK Add the value of group 2 at the end of group 1
Valuegroup:removeGroupByName(vartype:VARTYPE, libvarid:string, libvarid2:string, playerid1:number, playerid2:number) ErrorCode.OK Compare group 1 and group 2, and if group 1 has the same value as group 2, set it to nil
Valuegroup:deleteGroupByName(vartype:VARTYPE, libvarid:string, libvarid2:string, playerid1:number, playerid2:number) ErrorCode.OK Compare group 1 and group 2, and clear if there is the same value in group 1 as group 2
Valuegroup:insertGroupByName(vartype:VARTYPE, libvarid:string, no:number, libvarid2:string, playerid1:number, playerid2:number) ErrorCode.OK Insert the value of group 2 at the specified number position of group 1
Valuegroup:replaceValueByName(vartype:VARTYPE, libvarid:string, oldval:number, newval:number, playerid:number) ErrorCode.OK Replace any value in any group with a new value
Valuegroup:sortGroupByName(vartype:VARTYPE, libvarid:string, sortType:number, playerid1:number) ErrorCode.OK Sort any set of values
Valuegroup:hasValueByName(vartype:VARTYPE, libvarid:string, val:number, playerid:number) ErrorCode.OK Whether any group has any value, if there is a result return 0
Valuegroup:hasNoByName(vartype:VARTYPE, libvarid:string, no:number, playerid:number) ErrorCode.OK Whether there is a value in any group position, if there is, the result returns 0
Valuegroup:getValueCountByName(vartype:VARTYPE, libvarid:string, val:number, playerid:number) ErrorCode.OK libvarid:number Get the number of any value of any group
Valuegroup:getGroupNoByValue(vartype:VARTYPE, libvarid:string, val:number, playerid:number) ErrorCode.OK libvarid:number Get the number of any value in any group, if there are multiple same values, only return the first one
Valuegroup:getSpcialValueByName(libvarid:string, type:number) ErrorCode.OK Obtain the maximum and minimum values in the group

VarLib2 API list

Taken from VarLib2

Class:apiName(parameters) Return Description
VarLib2:setGlobalVarByName(actionattr:number, msg:string, val:number) ErrorCode.OK Set the global variables in the variable library
VarLib2:getGlobalVarByName(actionattr:number, msg:string) ErrorCode.OK val:any Get the global variables of the variable library
VarLib2:setPlayerVarByName(object:number, actionattr:number, msg:string, val:number) ErrorCode.OK Set private variables in the variable library
VarLib2:getPlayerVarByName(object:number, actionattr:number, msg:string) ErrorCode.OK val:any Get private variables in the variable library

ActionAttr list

Value Name Type Description
1 Position VarLib2 Position with Format of table as follow {x,y,z}
2 AreaIns VarLib2 Area stored as Areaid
3 Number VarLib2 Value stored as Number
4 Strinng VarLib2 Value stored as String
5 Boolean VarLib2 Value stored as True or False
6 Player VarLib2 Value of Playerid stored as Number of ID Player
7 PlayerGrout Valuegroup Value of Player Set
8 BlockType VarLib2 ID of Block as Number
9 ItemType VarLib2 ID of Item as Number
10 Creature VarLib2 Individual Creature as Number
11 ActorID VarLib2 ActorID
12 CreatureGroup Valuegroup Table Contains Creatureid
13 Timer VarLib2 Timer
14 EffectType VarLib2 ID of Special Effect
15 SiteGroup Valuegroup Table Contains Location
16 AreaGroup Valuegroup Table Contains Areaid
17 NumberGroup Valuegroup Table Contains Numbers
18 StringGroup Valuegroup Table Contains String
19 BooleanGroup Valuegroup Table Contains Boolean
20 BlockTypeGroup Valuegroup Table Contains ID of Block
21 ItemTypeGroup Valuegroup Table Contains ItemTypeGroup
22 CreatureTypeGroup Valuegroup Table Contains Creature Type
23 TimerGroup Valuegroup Table Contains Timer
24 EffectTypeGroup Valuegroup Table Contains ID of Special Effect
developer_center/developer_editor/script/valuegroup.txt · Last modified: 2025/05/23 03:00 by hhuxx