The Wiki for Tale 4 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

Difference between revisions of "User:Cegaiel/RegionFinder"

From A Tale in the Desert
Jump to navigationJump to search
Line 4: Line 4:
 
<pre>
 
<pre>
 
<HTML><head><title>Cegaiel's Region Finder</title></head>
 
<HTML><head><title>Cegaiel's Region Finder</title></head>
 
 
 
<body onload=region_frm.x.focus()>
 
<body onload=region_frm.x.focus()>
  
Line 13: Line 11:
 
<form name ="region" id="region_frm" action="#">
 
<form name ="region" id="region_frm" action="#">
 
X: <input type="text" name="name" id="x" size=3 onClick=region_frm.x.value="";> ,
 
X: <input type="text" name="name" id="x" size=3 onClick=region_frm.x.value="";> ,
Y: <input type="text" name="name" id="y" size=3 onChange="processFormData();">
+
Y: <input type="text" name="name" id="y" size=3 onClick=region_frm.y.value="";>
 
 
<input type="button" name="submit" value="GO" onclick="processFormData();">
 
  
 +
<input type="button" name="submit" value="GO" onClick="return processFormData();">
 
</form>
 
</form>
  
Line 22: Line 19:
  
 
function processFormData(){
 
function processFormData(){
 +
 +
 
var x = region_frm.x.value;
 
var x = region_frm.x.value;
 
var y = region_frm.y.value;
 
var y = region_frm.y.value;
 
var region = "";
 
var region = "";
 
var CS = "";
 
var CS = "";
 +
 +
 +
//Verify fields are not blank
 +
if (x==null||x=="")
 +
{
 +
alert("X field is blank!");return false;
 +
}
 +
if (y==null||y=="")
 +
{
 +
alert("Y field is blank!");return false;
 +
}
 +
 +
  
  
Line 56: Line 68:
 
CS = "764, -761";
 
CS = "764, -761";
  
}else if(x>=-3700 && x<=10 && y>=-2600 && y<=1600){
 
region="Khnum";
 
CS = "-2090, -480";
 
  
 
}else if(x>=-3700 && x<=10 && y>=1600 && y<=4449){
 
}else if(x>=-3700 && x<=10 && y>=1600 && y<=4449){
Line 93: Line 102:
 
CS = "3208, 4377";
 
CS = "3208, 4377";
  
 +
 +
 +
}else if(x>= -3700 && x<= 10 && y>= -2600 && y<= 1600){
 +
region="Khnum";
 +
CS = "-2090, -480";
  
  
Line 106: Line 120:
  
 
//Erase fields  
 
//Erase fields  
region_frm.x.value = "";
+
//region_frm.x.value = "";
region_frm.y.value = "";
+
//region_frm.y.value = "";
 
//Return focus to x field
 
//Return focus to x field
 
region_frm.x.focus();
 
region_frm.x.focus();
 +
  
 
}
 
}
 +
 
</script>
 
</script>
 
  
 
<div id="results"></div>
 
<div id="results"></div>
 
</pre>
 
</pre>

Revision as of 02:32, 20 January 2010

This is source code for a standalone html/javascript version that can be ran directly off your own computer or your own webserver. Just copy/paste and save as anything.htm or anything.html


<HTML><head><title>Cegaiel's Region Finder</title></head>
<body onload=region_frm.x.focus()>

<font face=verdana size=2>


<form name ="region" id="region_frm" action="#">
X: <input type="text" name="name" id="x" size=3 onClick=region_frm.x.value="";> ,
Y: <input type="text" name="name" id="y" size=3 onClick=region_frm.y.value="";>

<input type="button" name="submit" value="GO" onClick="return processFormData();">
</form>

<script language="JavaScript">

function processFormData(){


var x = region_frm.x.value;
var y = region_frm.y.value;
var region = "";
var CS = "";


//Verify fields are not blank
if (x==null||x=="")
{
alert("X field is blank!");return false;
}
if (y==null||y=="")
{
alert("Y field is blank!");return false;
}




	if(x >=2000 && x <= 5110 && y >=6000 && y <= 8194){
region = "Pyramid Lake";
CS = "4826, 7627";

}else if(x>=2630 && x<=5110 && y>=-2600 && y<=1000){
region = "Falcon's Lake";
CS = "4292, -633";

}else if(x>=-3700 && x<= 5110 && y>=-5000 && y<=-2600){
region = "Meroe";
CS = "824, -3656";

}else if(x>=-3700 && x<= 5110 && y >= -8200 && y<= -5000){
region = "Queen's Retreat";
CS = "591, -6169";

}else if(x>=10 && x<=2680 && y>=1000 && y<=2400){
region = "Shabbat Ab";
CS = "1417, 1789";

}else if(x>=10 && x<=2680 && y>=2400 && y<=4449){
region = "Stillwater";
CS = "1696, 3717";

}else if(x>=10 && x<=2630 && y>=-2600 && y<=1000){
region="Saqqarah";
CS = "764, -761";


}else if(x>=-3700 && x<=10 && y>=1600 && y<=4449){
result = "Nomad's Paradise";
CS = "-1419, 2769";

}else if(x>=-3700 && x<=-900 && y>=4449 && y<=8194){
region="Heaven's Gate";
CS = "-1683, 6317";

}else if(x>=-900 && x<= 10 && y>=4449 && y<=8194){
result = "Cat's Claw Ridge";
CS = "-403, 6577";

}else if(x>=10 && x<=2000 && y>=4449 && y<=8194){
region="ADN";
CS = "1030, 6956";

//Sinnai is not a perfect rectangle, so broke in into 3 perfect rectangles to cover the entire region

//Sinnai (1/3 blocks)
}else if(x>=2000 && x<=5110 && y>=4450 && y<=6000){
region="Sinai";
CS = "3208, 4377";

//Sinnai (2/3 blocks)
}else if(x>=2000 && x<=5110 && y>=2400 && y<=4450){
region="Sinai";
CS = "3208, 4377";

//Sinnai (3/3 blocks)
}else if(x>=3300 && x<=2400 && y>=1000 && y<=2400){
result = "Sinai";
CS = "3208, 4377";



}else if(x>= -3700 && x<= 10 && y>= -2600 && y<= 1600){
region="Khnum";
CS = "-2090, -480";


	}else{

region = "Unknown coordinates...";
CS = "Invalid";
}



document.getElementById('results').innerHTML=x+", "+y+"<BR><font color=red><B>"+region+"</b></font><BR><BR>"+CS+"<BR><font color=green><B>Chariot</b></font>";

//Erase fields 
//region_frm.x.value = "";
//region_frm.y.value = "";
//Return focus to x field
region_frm.x.focus();


}

</script>

<div id="results"></div>