Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - amigojapan

Pages: [1]
1
Programs / Re: What time is it? for Windows only
« on: January 02, 2020, 08:33:15 am »
Israel is with an s not a z.... sorry, not really a spell nazi :)

2
Programs / Re: Single Channel IRC client QB64
« on: January 01, 2020, 07:45:54 am »
thanks

3
Programs / Re: Single Channel IRC client QB64
« on: December 31, 2019, 11:03:13 pm »
yeah, did pretty much that, also made it easier to see what you are typing after a new commend comes in

4
Programs / Re: Single Channel IRC client QB64
« on: December 29, 2019, 08:00:18 pm »
Thanks, yeah backspace would require a bit more work, I guess I will do that, since it is pretty important

5
Programs / Single Channel IRC client QB64
« on: December 29, 2019, 02:54:56 am »
Code: QB64: [Select]
  1. server$ = "irc.freenode.net"
  2. nick$ = "your_nick_here"
  3. channel$ = "#QB64"
  4. client = _OPENCLIENT("TCP/IP:6667:" + server$)
  5. line$ = "nick " + nick$ + CHR$(13) + CHR$(10) + "user a a a a" + CHR$(13) + CHR$(10)
  6. PUT #client, , line$: SLEEP 2
  7. line$ = "join " + channel$ + CHR$(13) + CHR$(10)
  8. PUT #client, , line$: SLEEP 2
  9.  
  10.     _DELAY 0.05 ' 50ms delay (20 checks per second)
  11.     GET #client, , buff$
  12.     IF buff$ <> "" THEN
  13.         PRINT buff$
  14.         PRINT ""
  15.         PRINT user_input$;
  16.         IF INSTR(1, buff$, "PING") = 1 THEN 'handle PING
  17.             s$ = MID$(buff$, 5, LEN(buff$)) 'get orwell.freenode.net
  18.             line$ = "PONG" + s$ + CHR$(13) + CHR$(10)
  19.             PRINT "pong reached", line$
  20.             PUT #client, , line$: SLEEP 2
  21.         END IF
  22.     END IF
  23.     k$ = INKEY$
  24.     IF k$ <> "" THEN
  25.         IF k$ = CHR$(8) THEN
  26.             user_input$ = MID$(user_input$, 1, LEN(user_input$) - 1)
  27.             PRINT ""
  28.             PRINT user_input$;
  29.         ELSE IF k$ = CHR$(13) THEN
  30.                 line$ = "privmsg " + channel$ + " :" + user_input$ + CHR$(13) + CHR$(10)
  31.                 PUT #client, , line$: SLEEP 2
  32.                 user_input$ = ""
  33.                 PRINT ""
  34.             ELSE
  35.                 user_input$ = user_input$ + k$
  36.                 PRINT k$; 'echo user input ; eliminates new lines
  37.             END IF
  38.         END IF
  39.     END IF
  40. CLOSE client
  41.  

Pages: [1]