Wrote a proper IRC parser
There are limitations : currently the parser would loop infinitely if there were no \r\n (but the c wrapper would catch that), or if there were no spaces, and it would miss the cmd and params starting char if they were separated by more than one space. Those caveats aside, it works great! And that's more than enough for now.
This commit is contained in:
parent
42db0e92ef
commit
21258ec3e6
1 changed files with 19 additions and 6 deletions
23
bot.b98
23
bot.b98
|
@ -1,6 +1,19 @@
|
||||||
<v < > #;>:#,_e-j; "PASS my_secrets"da
|
< v < > #;>:#,_e-j; "PASS my_secrets"da p300
|
||||||
<v < > #;>:#,_e-j; "NICK b98"da
|
<v < > #;>:#,_e-j; "NICK b98"da
|
||||||
<v < > #;>:#,_e-j; "USER b98 0 0 b98"da
|
;v;<; < > #;>:#,_e-j; "USER b98 0 0 b98"da
|
||||||
<v < > #;>:#,_e-j; "JOIN #test"da
|
#####;len,pos,cmd,params,counter;
|
||||||
> >~:'P-#v_~'I-#v_~'N-#v_~'G-#v_ $ ad"uoarg GNOP"ck,v
|
################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
|
||||||
^$ <# < < < <
|
v < p300< <
|
||||||
|
v_d03g2-4g-| > 13gv
|
||||||
|
~ vp320p310< |+1g31g4p31-1:<p30:p31:-1g30 <
|
||||||
|
:-0> ;>3g23pv;# <^ ,kg30<
|
||||||
|
0a3| 1v < ;
|
||||||
|
3p3>v_^v_13g33p23g:1+13p4g'0-#v_13g:1+13p4g'0-#v_13g:1+13p4g'1-#v_ad"tset# nioj"bk,^
|
||||||
|
g4p#1- 1-v < < <
|
||||||
|
:p0-3 3 >23g:1+13p4g'P-#v_13g:1+13p4g'I-#v_13g:1+13p4g'N-#v_13g:1+13p4g'G-#v_13g:1+13p4g' -#v_'O14p^
|
||||||
|
134:g' g' ;v < < < < <
|
||||||
|
+0g':g :g ^<
|
||||||
|
>^>^14 14
|
||||||
|
+p +p
|
||||||
|
13 13
|
||||||
|
>^ >^
|
||||||
|
|
Reference in a new issue