Generated by OSCII-bot v0.6
Scripts use lines beginning with @ to specify various parameters:@import filename.txt -- note that only the file's functions will be imported, normal code in that file will not be executed.
z=x[y]; x[y]=z;You may use brackets to index into memory that is local to your script. Your script has approximately 8 million (8,388,608) slots of memory and you may access them either with fixed offsets (i.e. 16811[0]) or with variables (myBuffer[5]). The sum of the value to the left of the brackets and the value within the brackets is used to index memory. If a value in the brackets is omitted then only the value to the left of the brackets is used.
z=gmem[y]; gmem[y]=z;If 'gmem' is specified as the left parameter to the brackets, then the global shared buffer is used, which is approximately 1 million (1,048,576) slots that are shared across all scripts
x % 5 ? (
f += 1;
x *= 1.5;
) : (
f=max(3,f);
x=0;
);
z = (
a = 5;
b = 3;
a+b;
); // z will be set to 8, for example
a < 5 ? b = 6; // if a is less than 5, set b to 6
a < 5 ? b = 6 : c = 7; // if a is less than 5, set b to 6, otherwise set c to 7
a < 5 ? ( // if a is less than 5, set b to 6 and c to 7
b = 6;
c = 7;
);
(a < 5 ? b : c) = 8; // if a is less than 5, set b to 8, otherwise set c to 8
x = "hello world";
gfx_drawstr(x);
Literal strings are mutable in OSCII-bot, and you can also have other named strings:x = 50; // string slot 50 strcpy(x, "hello "); strcat(x, "world"); gfx_drawstr(x);This mode is useful if you need to build or load a table of strings.
x = #; strcpy(x, "hello "); strcat(x, "world"); gfx_drawstr(x);Note that the scope of these temporary instances is very limited and unpredictable, and their initial values are undefined.
x = #myString; strcpy(x, "hello world");The value of named strings is defined to be empty at script load, and to persist throughout the life of your script. There is also a shortcut to assign/append to named strings:
#myString = "hello "; // same as strcpy(#myString, "hello "); #myString += "world"; // same as strcat(#myString, "world");
while(expression)loop(count,expression)sin(angle)cos(angle)tan(angle)sqrt(value)log(value)log10(value)asin(value)acos(value)atan(value)atan2(numerator,denominator)exp(exponent)abs(value)sqr(value)min(&value,&value)max(&value,&value)sign(value)floor(value)ceil(value)invsqrt(value)freembuf(address)memcpy(dest,src,length)memset(offset,value,length)mem_get_values(offset, ...)mem_set_values(offset, ...)stack_push(&value)stack_pop(&value)stack_peek(index)stack_exch(&value)rand([max])midisend(device_index)midisend_str(device_index,"string")oscsend(device_index,"string"[,value,...])oscmatch("string"[,format-output])oscparm(parm_idx[,type,#string])get_device_open_time(device_index)printf("format"[, ...])sprintf(#dest,"format"[, ...])matchi("needle","haystack"[, ...])match("needle","haystack"[, ...])strlen("str")strcpy(#str,"srcstr")strcat(#str,"srcstr")strcmp("str","str2")stricmp("str","str2")strncmp("str","str2",maxlen)strnicmp("str","str2",maxlen)strncpy(#str,"srcstr",maxlen)strncat(#str,"srcstr",maxlen)strcpy_from(#str,"srcstr",offset)strcpy_substr(#str,"srcstr",offs,ml))str_getchar("str",offset[,type])str_setchar(#str,offset,val[,type]))str_setlen(#str,len)str_delsub(#str,pos,len)str_insert(#str,"srcstr",pos)sleep(ms)time([&val])time_precise([&val])eval("code")tcp_listen(port[,"interface",#ip_out])tcp_listen_end(port)tcp_connect("address",port[,block])tcp_send(connection,"str"[,len])tcp_recv(connection,#str[,maxlen])tcp_set_block(connection,block)tcp_close(connection)fopen("fn","mode")fclose(fp)fread(fp,#str,length)fgets(fp,#str)fgetc(fp)fwrite(fp,#str,len)fprintf(fp,"format"[,...])fseek(fp,offset,whence)ftell(fp)feof(fp)fflush(fp)gfx_init("name"[,width,height,xpos,ypos])gfx_quit()gfx_aaaaa()gfx_getchar([char])gfx_showmenu("str")gfx_setcursor(resource_id)gfx_lineto(x,y[,aa])gfx_line(x,y,x2,y2[,aa])gfx_rectto(x,y)gfx_rect(x,y,w,h[,filled])gfx_setpixel(r,g,b)gfx_getpixel(r,g,b)gfx_drawnumber(n,ndigits)gfx_drawchar(char)gfx_drawstr("str"[,flags,right,bottom])gfx_measurestr("str",&w,&h)gfx_measurechar(character,&w,&h)gfx_setfont(idx[,"fontface", sz, flags])gfx_getfont([#str])gfx_printf("format"[, ...])gfx_blurto(x,y)gfx_blit(source,scale,rotation)gfx_blit(source, scale, rotation[, srcx, srcy, srcw, srch, destx, desty, destw, desth, rotxoffs, rotyoffs])gfx_blitext(source,coordinatelist,rotation)gfx_getimgdim(image,w,h)gfx_setimgdim(image,w,h)gfx_loadimg(image,"filename")gfx_gradrect(x,y,w,h, r,g,b,a[, drdx, dgdx, dbdx, dadx, drdy, dgdy, dbdy, dady])gfx_muladdrect(x,y,w,h,mul_r,mul_g,mul_b[,mul_a,add_r,add_g,add_b,add_a])gfx_deltablit(srcimg,srcx,srcy,srcw,srch,destx,desty,destw,desth,dsdx,dtdx,dsdy,dtdy,dsdxdy,dtdxdy)gfx_transformblit(srcimg,destx,desty,destw,desth,div_w,div_h,table)gfx_circle(x,y,r[,fill,antialias])gfx_triangle(x1,y1,x2,y2,x3,y3[x4,y4...])gfx_roundrect(x,y,w,h,radius[,antialias])gfx_arc(x,y,r,ang1,ang2[,antialias])gfx_set(r[,g,b,a,mode,dest])gfx_clienttoscreen(x,y)gfx_screentoclient(x,y)