Author Topic: Advanced ClipCheck  (Read 59 times)

KutiePie

  • Global Moderator
  • Junior
  • *****
  • Posts: 62
    • View Profile
Advanced ClipCheck
« on: January 11, 2011, 10:45:11 pm »
if you can figure the rest of this out its all urs :P
currently it will read it but it wont let you log in. it will lag you out and not let you sign in. i have an easier one that i am going to post (: this one is kind of giving me a headache so im passin it on. it reads from a cfg file for the coordinates to look at and that is what is making it so confusing to work with. but it would be nice for future locations....
Code: [Select]
public void clipcheck()
{
String line = "";
String token = "";
String token2 = "";
String token2_2 = "";
String[] token3 = new String[25];
boolean EndOfFile = false;
int ReadMode = 0;
BufferedReader characterfile = null;

      try
{
      characterfile = new BufferedReader(new FileReader("clipchecking.cfg"));
      }
catch (FileNotFoundException fileex)
{
      misc.println("clipchecking.cfg: not found.");
      }
      try
{
      line = characterfile.readLine();
      }
catch (IOException ioexception)
{
      misc.println("clipchecking.cfg: error loading file.");
      }
      while (EndOfFile == false && line != null)
{
      line = line.trim();
      int spot = line.indexOf("=");
if (spot > -1)
{
            token = line.substring(0, spot);
                  token = token.trim();
                  token2 = line.substring(spot + 1);
                  token2 = token2.trim();
                  token2_2 = token2.replaceAll("\t\t", "\t");
                  token2_2 = token2_2.replaceAll("\t\t", "\t");
                  token2_2 = token2_2.replaceAll("\t\t", "\t");
                  token2_2 = token2_2.replaceAll("\t\t", "\t");
                  token2_2 = token2_2.replaceAll("\t\t", "\t");
                  token3 = token2_2.split("\t");
                  int RandomNum = 0;
          if (token.equals("clip"))
{
            String zone = token3[0];
            int X = Integer.parseInt(token3[1]);
          int X2 = Integer.parseInt(token3[2]);
          int Y = Integer.parseInt(token3[3]);
          int Y2 = Integer.parseInt(token3[4]);
if (((absX>=X)&&(absX<=X2))&&((absY==Y)||(absY==Y2)))
{
sendMessage("Flag A");
sendMessage("Current X:" + absX + " absY:" + absY);
                teleportToX = 2380;
                teleportToY = 3427;
}
if (((absY>=Y)&&(absY<=Y2))&&((absX==X)||(absX==X2)))
{
sendMessage("Flag B");
sendMessage("Current X:" + absX + " CurrentY:" + absY);
                teleportToX = 2380;
                teleportToY = 3427;
}
}   
}
      }

      if (line.equals("[EOCL]"))
{
try
{
                  characterfile.close();
            }
catch (IOException ioexception)
{//leave empty
}
      }

 
}

Share on Bluesky Share on Facebook