Chat system

Blitz3D Forums/Blitz3D Beginners Area/Chat system

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Heres an example
Dim key(50)
key(16) = 81
key(17) = 69
key(18) = 87
key(19) = 82
etc...
key(30) = 65
key(31) = 83
etc...
key(44) = 
etc...

;loop
while not keyhit(1)

  if keyhit(20) ;"T" go into text mode
    inputmess = true
  endif

  if inputmess = true
    for iter = 16 to 25 ;q to p
      if keyhit(iter) then message$ = message$ + chr$(key(iter))
    next
    for iter = 30 to 38; a to l
      if keyhit(iter) then message$ = message$ + chr$(key(iter))
    next
    for iter = 44 to 50; z to m
      if keyhit(iter) then message$ = message$ + chr$(key(iter))
    next
    if keyhit(enter)
      displaymess = true
      inputmess = false
      messdispstart = millisecs()
      SendMessageOverNetwork(message$)
    endif
  endif

  if inputmess = true or (displaymess = true and messdispstart + 5000 > millisecs())
    text 50, 450, message$
  endif

  if displaymess = true and millisecs() > messdispstart + 5000
    message$ = ""
    displaymess = false
  endif
wend