dim cyid as long dim mycyid as long dim msg[64] as char dim name[32] as char dim x as int dim y as int dim z as int dim xx as int dim yy[32] as char dim window[9,40] as char dim indow[40] as char option c_coords option escape off x=0 y=0 sub box(x0 as int, y0 as int, x1 as int, y1 as int) line x0,y0,x1,y0 line x1,y0,x1,y1 line x1,y1,x0,y1 line x0,y1,x0,y0 end sub sub reprint cls for i=0 to 8 printxy 2,i*10-2, window[i] next printxy 2,89,indow box(0,0,159,89) box(0,89,159,99) end sub sub getInput dim k as int z=0 indow[0] = 0 reprint k=key while k<>#KEY_ENTER if k<>0 then indow[z]=k indow[z+1]=0 printxy 2,89,indow z=z+1 if z=39 then exit while end if k = key if k=#KEY_ENTER AND indow[0]=0 then k=0 wend scroll window[8]=indow end sub sub scroll for i = 0 to 8 window[i] = window[i+1] next end sub sub onMessage(cyid as long, msgno as int, buf[] as char) dim tmp[40] as char scroll sprint tmp, ">", buf window[8] = tmp reprint beep 10 vibrate 128 wait 5 beep -1 vibrate 0 end sub cyid = usermenu("Select Chat Client", 0) name = touser(cyid) print cyid, "=", name while 1 getInput sendMessage cyid, 0, "chat", indow wend