
		if (IsDlgButtonChecked(h,IDC_CHECK1)==BST_CHECKED){
			if (beeper==0){
				SetDlgItemText(h,IDC_OUTPUT,"The system will beep if players enter your screen");
			}
			beeper=1;
		} else
			beeper=0;
		if (IsDlgButtonChecked(h,IDC_CHECK4)==BST_CHECKED){
			if (McA==0){
				SetDlgItemText(h,IDC_OUTPUT,"All clients will respond to MAGEBOT hotkeys; OTFollow mode activated;All clients following the main client will respond to attack commands; ");
				enemyfollow=2;
				otfollow=1;
			}
			McA=1;
		} else
			McA=0;
		if (IsDlgButtonChecked(h,IDC_CHECKKUE)==BST_CHECKED){
			if (uecombo==0){
				SetDlgItemText(h,IDC_OUTPUT,"If you wish to do combo UE or exori gran spells, put the combo leader as remote control character and your spell in the box next to this checkbox");
				uecombo=1;
				//otfollow=1;
			}
		} else
			uecombo=0;
		if (IsDlgButtonChecked(h,IDC_CHECKTEAMCOMBO)==BST_CHECKED){
			if (teamcombo==0){
				SetDlgItemText(h,IDC_OUTPUT,"If you wish to be a combo leader in your team server, check the box");
				teamcombo=1;
				//otfollow=1;
			}
		} else
			teamcombo=0;
		if (IsDlgButtonChecked(h,IDC_CHECKAUTOGHASTE)==BST_CHECKED){
			if (autoghaste==0){
				SetDlgItemText(h,IDC_OUTPUT,"If you with the bot to maintain great haste");
				autoghaste=1;
				//otfollow=1;
			}
		} else
			autoghaste=0;
		if (IsDlgButtonChecked(h,IDC_CHECKTEAMPOTION)==BST_CHECKED){
			if (teampotion==0){
				SetDlgItemText(h,IDC_OUTPUT,"If u wish to potion your friends using the potions in the autopotioner at the top left (mana/smana/gmana)");
				teampotion=1;
				//otfollow=1;
			}
		} else
			teampotion=0;
		if (IsDlgButtonChecked(h,IDC_CHECKBOOST)==BST_CHECKED){
			if (speedboostie==0){
				SetDlgItemText(h,IDC_OUTPUT,"Turn Speedboost on");
				speedboostie=1;speedboostiechk=1;
				char buf[20];
				buf[0]=19;
				buf[1]=112;
				buf[2]=0;
				sendbuf(buf);
				Beep(100,50);
				//otfollow=1;
			}
		} else {
			if (speedboostie==1){
				//sendbuf("oles");
				char buf[20];speedboostiechk=0;
				buf[0]=19;
				buf[1]=112;
				buf[2]=0;
				sendbuf(buf);speedboostie=0;
			}
			speedboostie=0;
		}
		if (IsDlgButtonChecked(h,IDC_CHECKBB)==BST_CHECKED){
			if (AutoEat==0){
				SetDlgItemText(h,IDC_OUTPUT,"Client will eat meat, ham, fish, brown mushrooms from open containers");
			}
			AutoEat=1;
		} else
			AutoEat=0;
		if (IsDlgButtonChecked(h,IDC_CHECK7)==BST_CHECKED){
			if (seller==0)
				SetDlgItemText(h,IDC_OUTPUT,"Please double click (LOOK) at any items you wish to sell");
			seller=1;
		}
		else
			seller=0;
		if (IsDlgButtonChecked(h,IDC_CHECK10)==BST_CHECKED){
			if (autossa==0){
				SetDlgItemText(h,IDC_OUTPUT,"SSAs will be loaded below 80% mana");
			}
			autossa=1;
		}
		else
			autossa=0;
		if (IsDlgButtonChecked(h,IDC_CHECK11)==BST_CHECKED){
			if (automanashield==0)
				SetDlgItemText(h,IDC_OUTPUT,"Manashield casted if you are attacked");
			automanashield=1;
		}
		else
			automanashield=0;
		if (IsDlgButtonChecked(h,IDC_LOOTBAG)==BST_CHECKED){
			if (lootbagging==0)
				SetDlgItemText(h,IDC_OUTPUT,"Please use the look (doubleclick) function on the backpack full of backpacks u wish to store loot in while it is on the ground.  Then press TAB");
			lootbagging=1;
		} else {
			tosserID=0;
			lootbagging=0;
		}
		/*if (IsDlgButtonChecked(h,IDC_LOOTALL)==BST_CHECKED){
			if (lootall==0)
				SetDlgItemText(h,IDC_OUTPUT,"Please leave your first open bp empty for the looter");
			lootall=1;
		} else
			lootall=0;*/
		if (IsDlgButtonChecked(h,IDC_MFCHK)==BST_CHECKED){
			if (manaswitch==0)
				SetDlgItemText(h,IDC_OUTPUT,"The first bp in your ground loot store bp should have ur bp manas.");
			manaswitch=1;
		}
		else
			manaswitch=0;
		if (IsDlgButtonChecked(h,IDC_CHAMELEON)==BST_CHECKED){
			if (chameleon==0)
				SetDlgItemText(h,IDC_OUTPUT,"Outfit match to Ground tile");
			chameleon=1;
		}
		else
			chameleon=0;
		if (IsDlgButtonChecked(h,IDC_CHECK5)==BST_CHECKED){
			if (ctrlchar==0)
				SetDlgItemText(h,IDC_OUTPUT,"Alert char can issue commands: \r\n Command list :\r\n .say text \r\n .follow charname (.follow 0 to stop) \r\n .otfollow charname(uses arrowkeys) \r\n .stopfire \r\n .sd charname(.gfb  + .hmm also work) \r\n .sd enemy(shoots skulls) \r\n .sd all (shoots non-safelist) \r\n .attack charname \r\n .players \r\n .channel 10(starts with 10) \r\n .mov x y(example .mov -1 4) \r\n .log (switches to the next character down .log 1 forthe next one up)");
			ctrlchar=1;
		}
		else
			ctrlchar=0;
		if (IsDlgButtonChecked(h,IDC_CHECK3)==BST_CHECKED){
			if (spyon==0){
				spyon=1;xray(1);
				SetDlgItemText(h,IDC_OUTPUT,"Use NumPad + and Numpad - to change view level");
			spyon=1;
			DoZChg(0);
			}
		}
		else {
			if (spyon==1) xray(0);
			spyon=0;
		}
		if (IsDlgButtonChecked(h,IDC_CHECK8)==BST_CHECKED){
			if (lootbkill==0)
				SetDlgItemText(h,IDC_OUTPUT,"Use this if u wish the cavebot to loot each monster before killing the next one");
			lootbkill=1;
		}
		else
			lootbkill=0;
		if (IsDlgButtonChecked(h,IDC_CHECK6)==BST_CHECKED){
			if (ppause==0)
				SetDlgItemText(h,IDC_OUTPUT,"The bot will pause if another player enters the screen.");
			ppause=1;
		}
		else
			ppause=0;
		if (IsDlgButtonChecked(h,IDC_CHECK19)==BST_CHECKED){
			if (alerts==0)
				SetDlgItemText(h,IDC_OUTPUT,"Sends default chat + damage messages to Alert char");
			alerts=1;
		}
		else
			alerts=0;
		/*if (IsDlgButtonChecked(h,IDC_CHECK4)==BST_CHECKED){
			if (summonids[0]==0){
				SetDlgItemText(h,IDC_OUTPUT,"If you wish the bot to avoid targetting your summons, please check this after summoning");
				GetSummons();
			}
			summonids[0]=1;
		}
		else
			summonids[0]=0;*/
		if (IsDlgButtonChecked(h,IDC_CHECK9)==BST_CHECKED){
			if (antiidle==0){
				SetDlgItemText(h,IDC_OUTPUT,"char wont log");
				antiidle=1;
			}
		}
		else
			antiidle=0;
		if (IsDlgButtonChecked(h,IDC_CHECK2)==BST_CHECKED){
			if (ecolors==0){
				SetDlgItemText(h,IDC_OUTPUT,"Skulled chars will be given special outfits.");
				ecolors=1;
			}
		}
		else
			ecolors=0;
		if (IsDlgButtonChecked(h,IDC_CHECK14)==BST_CHECKED){
			if (shootnonsafe==0){
				SetDlgItemText(h,IDC_OUTPUT,"If an autofirehotkey (SD/GFB ect) is pressed the bot will automatically fire at any character not in Safelist.txt");
				shootnonsafe=1;
			}
		}
		else
			shootnonsafe=0;
		if (IsDlgButtonChecked(h,IDC_CHECK15)==BST_CHECKED){
			if (shootskulls==0){
				SetDlgItemText(h,IDC_OUTPUT,"If an autofirehotkey (SD/GFB ect) is pressed the bot will automatically fire at any character marked with a skull on the viplist");
			}
				shootskulls=1;
		}
		else
			shootskulls=0;
		if (IsDlgButtonChecked(h,IDC_CHECK17)==BST_CHECKED){
			if (healsio==0){
				SetDlgItemText(h,IDC_OUTPUT,"Bot heals all players in VIP marked with a heart using EXURA SIO");
			}
				healsio=1;
		}
		else
			healsio=0;
		if (IsDlgButtonChecked(h,IDC_CHECKRUNE)==BST_CHECKED){
			if (runemaker==0){
				SetDlgItemText(h,IDC_OUTPUT,"1.Put RuneSpell in box 2.open bp with blanks 3. Make right hand empty");
			}
				runemaker=1;
		}
		else
			runemaker=0;
		if (IsDlgButtonChecked(h,IDC_CHECKSTEP)==BST_CHECKED){
			if (stepbacker==0){
				SetDlgItemText(h,IDC_OUTPUT,"Bot steps back on attack or person on screen/ steps forward 5mins later if no person on screen");
			}
				stepbacker=1;
				stepbacked=0;
		}
		else
			stepbacker=0;
		if (IsDlgButtonChecked(h,IDC_CHECKHOLDATK)==BST_CHECKED){
			if (holdattack=0){
				SetDlgItemText(h,IDC_OUTPUT,"Bot steps back on attack or person on screen/ steps forward 5mins later if no person on screen");
			}
				holdattack=1;
				keepattackid=0;
		}
		else
			holdattack=0;
		if (IsDlgButtonChecked(h,IDC_CHECKLOG)==BST_CHECKED){
			if (autologger==0){
				SetDlgItemText(h,IDC_OUTPUT,"Bot autologs if person on screen");
			}
				autologger=1;
		}
		else
			autologger=0;
		if (IsDlgButtonChecked(h,IDC_CHECK20)==BST_CHECKED){
			if (autouhheart==0){
				SetDlgItemText(h,IDC_OUTPUT,"Bot heals all players in VIP marked with a heart using UH RUNES");
			}
				autouhheart=1;
		}
		else
			autouhheart=0;
		if (IsDlgButtonChecked(h,IDC_CHECK16)==BST_CHECKED){
			if (dumploot==0){
				SetDlgItemText(h,IDC_OUTPUT,"Cavebot will toss loot on the ground from your 1st bp. Stand on the square you wish the bot to dump loot on.");
				tosserID=2;
				bpx=rB(PLAYER_X,4);
				bpy=rB(PLAYER_Y,4);
				bpz=rB(PLAYER_Z,4);
			}
				dumploot=1;
		}
		else
			dumploot=0;
		if (IsDlgButtonChecked(h,IDC_CHECK18)==BST_CHECKED){
			if (autoloot==0){
				SetDlgItemText(h,IDC_OUTPUT,"Auto Loot corpses. Items are tossed into your bps based on the itenids.txt file");
			}
				autoloot=1;
		}
		else
			autoloot=0;
		if (IsDlgButtonChecked(h,IDC_CHECK21)==BST_CHECKED){
			if (autoopen==0){
				SetDlgItemText(h,IDC_OUTPUT,"Auto opens corpses for looting");
			}
				autoopen=1;
		}
		else
			autoopen=0;
		if (IsDlgButtonChecked(h,IDC_CHECKSKINNER)==BST_CHECKED){
			if (skinneron==0){
				SetDlgItemText(h,IDC_OUTPUT,"Auto skins corpses");
			}
				skinneron=1;
		}
		else
			skinneron=0;
		if (IsDlgButtonChecked(h,IDC_CHECKUHA)==BST_CHECKED){
			if (UHA==0){
				UHA=1;
				SetDlgItemText(h,IDC_OUTPUT,"Change heavy and Light Healing Spells to UH runes");
				SetDlgItemText(h,IDC_EDIT1,"UH");
		SetDlgItemText(h,IDC_EDIT2,"UH");
		//SetDlgItemText(h,IDC_OUTPUT,"Change heavy and Light Healing Spells to UH runes");
			}
				UHA=1;
		}
		else
			UHA=0;
		if (IsDlgButtonChecked(h,IDC_CHECKUHN)==BST_CHECKED){
			if (UHN==0){
				UHN=1;
				SetDlgItemText(h,IDC_OUTPUT,"Use UH Rune if there is not enough mana to cast heavy healing");
				//SetDlgItemText(h,IDC_EDIT1,"UH");
		//SetDlgItemText(h,IDC_EDIT2,"UH");
			}
				UHN=1;
		}
		else
			UHN=0;
		if (IsDlgButtonChecked(h,IDC_CHECKCKR)==BST_CHECKED){
			if (CKR==0){
				CKR=1;
				SetDlgItemText(h,IDC_OUTPUT,"Enable Click-Reuse");
				//SetDlgItemText(h,IDC_EDIT1,"UH");
		//SetDlgItemText(h,IDC_EDIT2,"UH");
			}
				CKR=1;
		}
		else
			CKR=0;
		if ((int) LOWORD(w)==IDC_EDIT1)
			SetDlgItemText(h,IDC_OUTPUT,"Your light healing spell choices= exura | exura gran | exura vita | UH");
		if ((int) LOWORD(w)==IDC_EDIT1)
			SetDlgItemText(h,IDC_OUTPUT,"Your light healing spell choices= exura | exura gran | exura vita | UH");
		if ((int) LOWORD(w)==IDC_EDIT7)
			SetDlgItemText(h,IDC_OUTPUT,"This is the health percent that you wish the bot to use the light healing spell");
		if ((int) LOWORD(w)==IDC_EDITEND)
			SetDlgItemText(h,IDC_OUTPUT,"Your choices for the key remapper = SD | GFB | EXP | HMM | AUTOSSA | MWALL | F1-F12 | FRIEND | POTSPAM | FOLLOW | POTFIRE | fOLLOW | LOOT | STARTBOT");
		if ((int) LOWORD(w)==IDC_EDIT5)
			SetDlgItemText(h,IDC_OUTPUT,"This number is the time the bot will wait before attempting to shoot an attack rune. 1000 = 1 second");
		if ((int) LOWORD(w)==IDC_EDIT2)
			SetDlgItemText(h,IDC_OUTPUT,"Your heavy healing spell choices= exura vita | exura sio name | UH");
		if ((int) LOWORD(w)==IDC_EDIT4)
			SetDlgItemText(h,IDC_OUTPUT,"This number is the range at which the cavebot will attack monsters.");
		if ((int) LOWORD(w)==IDC_EDIT3)
			SetDlgItemText(h,IDC_OUTPUT,"For this box you may put a spell (exori vis) or type (Run) or (Run;HMM). If you use Run mode set the range to the distance you want the bot to keep, and if you are using ammo(arrows/bolts) change the MF bp to the backpack number you are keeping your ammo in.");
		if ((int) LOWORD(w)==IDC_EDITSAYATTACK1)
			SetDlgItemText(h,IDC_OUTPUT,"For this box you may enter the character u wish to recieve alerts and/or remote control while you are afk. If you do not wish to recieve a certain characters messages type the character name inside Safelist.txt. This does not affect the remote control.");
		if ((int) LOWORD(w)==IDC_EDITSAYATTACK)
			SetDlgItemText(h,IDC_OUTPUT,"This is your autoresponder");
		if ((int) LOWORD(w)==IDC_EDIT16)
			SetDlgItemText(h,IDC_OUTPUT,"This sets your looting speed. 500ms means you will loot one item every half a second.");
		if ((int) LOWORD(w)==IDC_MFBP)
			SetDlgItemText(h,IDC_OUTPUT,"This number is the BP where u carry ur manas.");
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON5)){
			WriteScreen("MAGEBOMB LOADED from lognoobs.txt PRESS MAGESTOP to Cancel");
		//DoLogNoobs();
		}
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON6)){
			noobson=0;
			WriteScreen("Attempting to log off noobs, Magebomb unloaded");
		}
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON1))
			sorter(0,1);
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON2))
			sorter(0,10);
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON9))
			buymana();
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_START))
			start();
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_STOP))
			stop();
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_LOAD))
			load();
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_SAVE))
			save();
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON4))
			loadg();
		//if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTONRECON))
		//	reconnect();
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON7))
			savesettings(h);
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTONNAVI)){
			DWORD hRet=0;
			if (navion==0)
			CreateThread(NULL,0,navi,0,0,(DWORD *) &hRet);
		}
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTONVIPCHECK)){
			vipchker();
		}
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON8)){
			GetDlgItemText(h,IDC_EDIT20,P,50);
			chgip(P);
		}
		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_BUTTON3)){
			GetDlgItemText(h,IDC_EDIT9,Kserial,50);
			if (keyloaded==0){
			FILE *f=fopen("bot.key","w+b");
			if (f!=NULL){
				fwrite(Kserial,1,50,f);
				fseek(f,0,SEEK_END);int a=ftell(f);
				rewind(f);
				fread(p,1,a,f);fclose(f);
				p[a]=0;
				unsigned int aa=atoi(p);
				unsigned int bb=macad;

	//XTEA_KEY=
				if ((aa ^ bb)!=0x0075A8EA)
					SetDlgItemText(h,IDC_OUTPUT,"Invalid Key");
				else{
					keyloaded=1;
					SetDlgItemText(h,IDC_OUTPUT,"Correct Key! Enjoy");
				}
			}
			}
		}

		if (((int) HIWORD(w)==BN_CLICKED) && ((int) LOWORD(w)==IDC_RECORD)){
			SetDlgItemText(h,IDC_OUTPUT,"Walk in a loop and then press the save button");
			record();
		}
