Bit long?Not really,I don't actually think anyone will read 100lines of code
R G B
I started learning 39dll,I already understood the concept and all(Hilarious when I posted on forums and helped those who are doing things I don't even care to do(Yes,the same goes for d3d.The need to use an extra axis isn't evident to me,and personally just looks like more work as I already have to deal with double coding for X and Y))Anyways,I made a pretty nice select screen with a scrolling grid and bars.About 100lines of code in RoomCreate to bypass the need for objects.So want the code?Sure…BUT BEFORE THATI also made a little hacking console,it is to be used alongside other things.Basically it just sends bytes to a game.Simple?Veryvar v2,v3,red,gre,blu,mbleft,ip,cl1,cl2;v=0;v2=0
red=128;blu=128;gre=128;global.name=""
global.servmax=9
if file_exists("Profile"){
v3=file_text_open_read("Profile")
global.name=file_text_read_string(v3)
red=file_text_read_real(v3)
gre=file_text_read_real(v3)
blu=file_text_read_real(v3)
file_text_close(v3)
}
mbleft=0;ip="127.0.0.1";global.color=make_color_rgb(red,gre,blu)
global.nxus=0
cl1=0;cl2=0
window_set_visible(1)
draw_set_font(fnt)
dllinit(1)
do{
io_handle()
draw_rectangle_color(0,0,room_width,room_height,255,64,c_yellow,64,0)
draw_set_color(-1)
draw_set_alpha(.3)
draw_set_blend_mode(1)
v3=v2-640
repeat(60){
v3+=32
draw_line((v2+v3)/2,0,(v2+v3)/3,320)
draw_line(0,(v2+v3)/2,320,(v2+v3)/3)
}
v2+=.5
v2=v2 mod 320
draw_set_blend_mode(0)
draw_set_alpha(.5)
draw_set_color(make_color_rgb(128+mchk(20,128,56,144)*127,128+mchk(20,128,56,144)*127,128+mchk(20,128,56,144)*127))
draw_rectangle(20,128,56,144,0)
draw_set_color(make_color_rgb(128+mchk(20,144,56,160)*127,128+mchk(20,144,56,160)*127,128+mchk(20,144,56,160)*127))
draw_rectangle(20,144,56,160,0)
draw_set_color(make_color_rgb(128+mchk(20,160,56,176)*127,128+mchk(20,160,56,176)*127,128+mchk(20,160,56,176)*127))
draw_rectangle(20,160,56,176,0)
draw_set_color(make_color_rgb(128+(mchk(20,176,56,192)||cl1)*127,128+(mchk(20,176,56,192)||cl1)*127,128+(mchk(20,176,56,192)||cl1)*127))
draw_rectangle(20,176,56,192,0)
draw_set_color(make_color_rgb(128+(mchk(20,192,56,208)||cl2)*127,128+(mchk(20,192,56,208)||cl2)*127,128+(mchk(20,192,56,208)||cl2)*127))
draw_rectangle(20,192,56,208,0)
draw_set_color(-1)
draw_text(25,132,"HOST")
draw_text(25,148,"JOIN")
draw_text(25,164,"SAVE")
draw_text(25,179,"NAME "+global.name)
draw_text(25,195,"ADDR "+ip)
draw_set_alpha(.6)
draw_set_color(global.color)
draw_rectangle(54,126,313,178,0)
draw_set_color(make_color_rgb(red,0,0))
draw_rectangle(56,128,56+red,144,0)
draw_set_color(make_color_rgb(0,gre,0))
draw_rectangle(56,144,56+gre,160,0)
draw_set_color(make_color_rgb(0,0,blu))
draw_rectangle(56,160,56+blu,176,0)
if mouse_check_button(mb_left){
if mouse_x>56&&mouse_x<311{
if mouse_y>128&&mouse_y<144{red+=sign((mouse_x-56)-red);global.color=make_color_rgb(red,gre,blu)}
if mouse_y>144&&mouse_y<160{gre+=sign((mouse_x-56)-gre);global.color=make_color_rgb(red,gre,blu)}
if mouse_y>160&&mouse_y<176{blu+=sign((mouse_x-56)-blu);global.color=make_color_rgb(red,gre,blu)}
}
if!mbleft&&mouse_x>20&&mouse_x<56{
if mouse_y>128&&mouse_y<144{global.host=1
global.nxus=tcplisten(3700,1,1)
if global.nxus>0{
global.pid[0]=1
global.pid[1]=1
global.join=1
global.dis[1]=0
global.name[1]=global.name
global.color[1]=global.color
}else{show_message("FAIL")}}
if mouse_y>144&&mouse_y<160{global.host=0
global.nxus=tcpconnect(ip,3700,1)
if global.nxus<=0{show_message("FAIL")}}
if mouse_y>160&&mouse_y<176{
v3=file_text_open_write("Profile")
file_text_write_string(v3,global.name)
file_text_writeln(v3)
file_text_write_string(v3,string(red))
file_text_writeln(v3)
file_text_write_string(v3,string(gre))
file_text_writeln(v3)
file_text_write_string(v3,string(blu))
file_text_close(v3)
}
if mouse_y>176&&mouse_y<192{
cl1=!cl1
cl2=0
keyboard_string=global.name
}
if mouse_y>192&&mouse_y<208{
cl2=!cl2
cl1=0
keyboard_string=ip
}
}}
if keyboard_check(vk_escape){game_end();global.nxus=1}
if keyboard_check(vk_enter){
if cl1{cl1=0}
if cl2{cl2=0}}
if keyboard_check(vk_control){keyboard_string=clipboard_get_text()}
mbleft=mouse_check_button(mb_left)
if cl1{global.name=string_copy(string_replace_all(keyboard_string,"#","#"),0,9)}
if cl2{ip=keyboard_string}
screen_redraw()
sleep(8)
}until global.nxus>0
if!keyboard_check(vk_escape){(instance_create(0,0,mplay)).type=0;room=loby}
I can't be bothered reading all that :o
Yay. You know I love that background!
Oh, and centred code is hard to read. >=|Don't complain to me,complain the CSShack I can't really control
And yes,neither can I be bothered to read it.Just write itWell,being a loop that has pauses and all it doesn't lag much.Thanks to my slow computer,I can assume that anything running smoothly on it can work with anyone
Besides that,many things are bundled in if{}s,so that helps