====== VarLib Class ====== Class For VarLib Interface [[developer_center:developer_editor:script|Return To Previous Page]] ------ ===== API list ===== ^ 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 | ===== Valuegroup API list ===== Taken from [[developer_center:developer_editor:script:valuegroup|Valuegroup]] ^ Class:apiName(parameters) ^ Return ^ Description ^ | Valuegroup:getAllGroupItem(vartype:VARTYPE, libname:string, playerid:number) | ErrorCode.OK ret:table | Get all the values in the variable group | | Valuegroup:insertInGroupByName(vartype:VARTYPE, libvarid:string, value:number, playerid:number) | ErrorCode.OK | Add any value to any group, and add it to the last digit of the group | | Valuegroup:removeValueIndexByName(vartype:VARTYPE, libvarid:string, indx:number, playerid:number) | ErrorCode.OK | Remove the value of the specified number from any group, become nil, and the number will not be removed | | Valuegroup:removeValueByName(vartype:VARTYPE, libvarid:string, value:number, playerid:number) | ErrorCode.OK | Remove any value of nil from any group | | Valuegroup:clearGroupByName(vartype:VARTYPE, libvarid:string, playerid:number) | ErrorCode.OK | Clear any group, number, and content are all cleared | | Valuegroup:getGrouplengthByName(vartype:VARTYPE, libvarid:string, playerid:number) | ErrorCode.OK number:number | Get the length of the array | | Valuegroup:getValueNoByName(vartype:VARTYPE, libvarid:string, indx:number, playerid:number) | ErrorCode.OK libvarid:number | Get the value of the specified number in the group | | Valuegroup:setValueNoByName(vartype:VARTYPE, libvarid:string, indx:number, value:number, playerid:number) | ErrorCode.OK | Set the value of the number index in the group | | Valuegroup:getRandomValueByName(vartype:VARTYPE, libvarid:string) | ErrorCode.OK value:number | Randomly obtain the value in the array | | Valuegroup:insertValueByName(vartype:VARTYPE, libvarid:string, no:number, value:number, playerid:number) | ErrorCode.OK | Insert any value at any numbered position in any group | | Valuegroup:deleteNoByName(vartype:VARTYPE, libvarid:string, no:number, playerid:number) | ErrorCode.OK | Clear the value of the specified number from any group | | Valuegroup:deleteValueByName(vartype:VARTYPE, libvarid:string, val:number, playerid:number) | ErrorCode.OK | Clear the specified value from any 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, 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 | ===== 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 |