//Fan Control Script //Turns on fan at user selectable temperature. //Author: 93turbo16 num fanc = 0; num fanh = 0; num i = 0; void open(){ x = 10; y = 330; CreateBorder(x, y, 200, 75, 5, 0, ""); CreateStatic(x+5, y-5, 80, 20, 5, 0, "Fan Control"); fanc = CreateCombo(x+20, y + 20, 100, 100, 5, "Fan Control"); setitem(fanc, "170"); setitem(fanc, "175"); setitem(fanc, "180"); setitem(fanc, "185"); setitem(fanc, "190"); setitem(fanc, "195"); setitem(fanc, "200"); if(round(calctemp(readbyte(0x7465))) == 170){ setitemex(fanc, 0, 0, 0); } if(round(calctemp(readbyte(0x7465))) == 175){ setitemex(fanc, 1, 0, 0); } if(round(calctemp(readbyte(0x7465))) == 180){ setitemex(fanc, 2, 0, 0); } if(round(calctemp(readbyte(0x7465))) == 186){ setitemex(fanc, 3, 0, 0); } if(round(calctemp(readbyte(0x7465))) == 190){ setitemex(fanc, 4, 0, 0); } if(round(calctemp(readbyte(0x7465))) == 194){ setitemex(fanc, 5, 0, 0); } if(round(calctemp(readbyte(0x7465))) == 200){ setitemex(fanc, 6, 0, 0); } CreateStatic(x+125, y+20, 70, 20, 5, 0, "Fan Control"); Fand = CreateEdit(x+125, y+50, 60, 20, 5, 0, "Fand"); setitem(Fand, round(calctemp((readbyte(0x7465))), 0); fanh = CreateCheck(x+20, y+50, 70, 20, 5, 0, "Enable"); if((readbyte(0x44C5)) == 0x03) setitem(fanh, 1); else setitem(fanh, 0); } void save(){ if(getitem(fanh) == 1){ assemble("Fan.asm", 0x7466); writebyte(0x44c5, 0x03); writebyte(0x44c6, 0x66); writebyte(0x44c7, 0x746); num x = getitem(fanc); if(x == 0){ writebyte(0x7465, 0x95); // 170 (2C) 95 = test @115 } if(x == 1){ writebyte(0x7465, 0x29); // 175 } if(x == 2){ writebyte(0x7465, 0x26); // 180 } if(x == 3){ writebyte(0x7465, 0x23); // 185 } if(x == 4){ writebyte(0x7465, 0x21); // 190 } if(x == 5){ writebyte(0x7465, 0x1F); // 195 } if(x == 6){ writebyte(0x7465, 0x1C); // 200 } } else{ writebyte(0x44c5, 0xc5); writeword(0x44c6, 0x3B20); //writebyte(0x44c6, 0x3B); //writebyte(0x44c7, 0x20); } }