recursiveDialog
Revision as of 11:02, 6 November 2010 by Spoof Kelberry (talk | contribs) (Created page with '{{LSL_Function |func=recursiveDialog |mode=user |p1_type=key|p1_name=agent|p1_desc=key of the agent |p2_type=string|p2_name=message|p2_desc=message to be displayed |p3_type=list|...')
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Specification
<lsl> //Created by Spoof Kelberry recursiveDialog(key avatar, string message, list buttons, integer channel){
integer a = llGetListLength(buttons)%12; integer i; integer c = llFloor(llGetListLength(buttons)/12)+1; integer q; integer j; for(i = 0; i < c-1; i++){ list w; w = llList2List(buttons,j,j+11); j += 12; llDialog(avatar,message,w,channel); } if(a) llDialog(avatar,message,llList2List(buttons,j,j+a),channel);
} </lsl>
Examples
<lsl> //Created by Spoof Kelberry recursiveDialog(key avatar, string message, list buttons, integer channel){
integer a = llGetListLength(buttons)%12; integer i; integer c = llFloor(llGetListLength(buttons)/12)+1; integer q; integer j; for(i = 0; i < c-1; i++){ list w; w = llList2List(buttons,j,j+11); j += 12; llDialog(avatar,message,w,channel); } if(a) llDialog(avatar,message,llList2List(buttons,j,j+a),channel);
} default {
state_entry() { recursiveDialog(llGetOwner(),"Hello!",["This","list","is","greater","than","12","elements","but","it","will","create","another","dialog."],-1); }
}
</lsl>