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
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
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
 
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
 +
 +
 +
To view a working example, go here: http://sharpnetwork.net/atitd/region_java.htm
  
  
 
<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 14:
 
<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 22:
  
 
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 33: Line 48:
  
 
}else if(x>=2630 && x<=5110 && y>=-2600 && y<=1000){
 
}else if(x>=2630 && x<=5110 && y>=-2600 && y<=1000){
region = "Falcon's Lake";
+
region = "Falcon's Bay";
 
CS = "4292, -633";
 
CS = "4292, -633";
  
Line 44: Line 59:
 
CS = "591, -6169";
 
CS = "591, -6169";
  
}else if(x>=10 && x<=2680 && y>=1000 && y<=2400){
+
}else if(x>=10 && x<=3100 && y>=1000 && y<=2400){
 
region = "Shabbat Ab";
 
region = "Shabbat Ab";
 
CS = "1417, 1789";
 
CS = "1417, 1789";
Line 56: Line 71:
 
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 89: Line 101:
  
 
//Sinnai (3/3 blocks)
 
//Sinnai (3/3 blocks)
}else if(x>=3300 && x<=2400 && y>=1000 && y<=2400){
+
}else if(x>=3300 && x<=5110 && y>=1000 && y<=2400){
 
result = "Sinai";
 
result = "Sinai";
 
CS = "3208, 4377";
 
CS = "3208, 4377";
  
 +
 +
 +
}else if(x>= -3700 && x<= 10 && y>= -2600 && y<= 1600){
 +
region="Khnum";
 +
CS = "-2090, -480";
  
  
 
}else{
 
}else{
  
region = "Unknown coordinates...";
+
region = "Invalid coordinates...";
 
CS = "Invalid";
 
CS = "Invalid";
 
}
 
}
Line 110: Line 127:
 
//Return focus to x field
 
//Return focus to x field
 
region_frm.x.focus();
 
region_frm.x.focus();
 +
  
 
}
 
}
 
 
  
 
</script>
 
</script>

Latest revision as of 05:03, 20 February 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


To view a working example, go here: http://sharpnetwork.net/atitd/region_java.htm


<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 Bay";
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<=3100 && 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<=5110 && 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 = "Invalid 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>