Potter.zzs
import Zz.*;
import prototype.*;
import ZzConst.*;
import Shd_DetectNewLib.*;
import Zz_GS_Blacksmithy.*;
find = new ZzFind();
cmd = new ZzCommand();
obj = new ZzObjectInfo();
det = new ZzObjectDetail();
pktw = new ZzPacketWait();
info = new ZzInfo();
println('-************POTter*************-');
println('設定はしたか?');
println('そのまま使ったらじゃんじゃん使っちまうぞ。');
println('-************POTter*************-');
//-----------------------------------------------------------------/
hitsDame = 25; //ステータスのMAXからここの数値が引かれてた場合POTを使う
stamDame = 20;
yellowPotGrade = 2; //0=レッサー,1=ノーマル,2=グレード 種類によってウエイトの時間を変えている。
curePotuse = 0; //キュアポットを0=使わない, 1=使う。
//-----------------------------------------------------------------/
hits = info.playerHits;
hitsMax = info.playerHitsMax;
stam = info.playerStam;
stamMax = info.playerStamMax;
yellowPot = find.find('be, m0xF0C');
curepot = find.find('be, m0xF07');
redPot = find.find('be, m0xF0B');
bulePot = find.find('be, m0xF08');
whitePot = find.find('be, m0xF09');
var usetime = new Date();
var statsWaiteTime = new Date();
fastuse = 0;
if (yellowPotGrade == 0 || yellowPotGrade == 1 || yellowPotGrade == 2 ){
}else{
 halt('ヒールポットの種類設定が正しくねーよ。');
}
if (curePotuse == 0 || curePotuse == 1 ){
}else{
 halt('キュアポットの種類設定が正しくねーよ。');
}
if(yellowPotGrade == 0){
 timersc = 4;
}else{
 if(yellowPotGrade == 1){
  timersc = 9;
 }else{
  timersc = 11;
 }
} 
while(yellowPot != 0 || redPot != 0){
 hits = info.playerHits;
 hitsMax = info.playerHitsMax;
 stam = info.playerStam;
 stamMax = info.playerStamMax;
 var timers = new Date();
 var statstimer = new Date();
 spwt = parseInt( (statstimer - statsWaiteTime) / 1000 );
sleep(1);
 yellowPot = find.find('be, m0xF0C', 1);
 redPot = find.find('be, m0xF0B', 1);
 bulePot = find.find('be, m0xF08', 1);
 whitePot = find.find('be, m0xF09', 1);
 if( ( hitsMax - hits ) >= hitsDame ){
 potwaitetimes = parseInt( (timers - usetime) / 1000 );
  if(potwaitetimes >= timersc){
   if(info.playerStatus(0x40E)){
    if(curePotuse==1){
     cmd.doubleClick (curepot);
     cmd.display('use CurePot', info.playerName, info.playerId, 0x478);
     }else{
     cmd.display('Player is Poison!!', info.playerName, info.playerId, 0x47E);
     }
   }else{
    cmd.display('use YellowPot', info.playerName, info.playerId, 0x478);
    cmd.doubleClick (yellowPot);
    var usetime = new Date();
   }
  }
 }
 if( ( stamMax - stam ) >= stamDame ){
 cmd.doubleClick(redPot);
 cmd.display('use RedPot', info.playerName, info.playerId, 0x478);
 }
 
 if(fastuse == 0){
 fastuse = 1;
 cmd.doubleClick (bulePot);
 cmd.doubleClick (whitePot);
 }
 
 if( spwt >= 120 ){
   cmd.display('use StatsPots', info.playerName, info.playerId, 0x478);
   cmd.doubleClick (bulePot);
   cmd.doubleClick (whitePot);
   var statsWaiteTime = new Date();
 }
}
println('Potが切れたよ!');