var QA = new ActiveXObject("Scripting.Dictionary" [Wink] ;
var Wrong = new ActiveXObject("Scripting.Dictionary" [Wink] ;
function ChatClear(){
Chat.obj.text = "";
}
function DisplayClear(){
Display.text = "";
}
function WriteLog(Fname,data){
var ForAppending = 8;
var fso = new ActiveXObject("Scripting.FileSystemObject" [Wink] ;
var a = fso.OpenTextFile(Fname, ForAppending, true, false);
a.WriteLine(data);
a.Close();
}
function ClearLog(Fname){
var ForWriting = 2;
var fso = new ActiveXObject("Scripting.FileSystemObject" [Wink] ;
var a = fso.OpenTextFile(Fname, ForWriting, true, false);
a.WriteLine("" [Wink] ;
a.Close();
}
function Cdebug(message,color) {
Chat.obj.SelStart = Chat.obj.text.length
Chat.obj.SelLength = 0
Chat.obj.SelColor = color // set color
Chat.obj.SelText = "\n" + message // append message to richtextbox
}
function get_random(min,max) {
var ranNum= min + Math.round(Math.random()*(max-min));
return ranNum;
}
function Sit(direction){
ts.SendAction(45+direction)
}
function FindItemInSlot(ItemName){
for(var i=1;i<=25;i++){
var oSlot = ts.MyItems(i);
if( oSlot.itemid == 0){ continue; }
if(oSlot.itemid == 46107){ continue; }
var oItem = ITEMS.Item(oSlot.itemid)
;
if(oItem.getName() == ItemName){
return oSlot;
}
}
return false;
}
function FindItemInSlotByQty(ItemName,num){
for(var i=1;i<=25;i++){
var oSlot = ts.MyItems(i);
if( oSlot.itemid == 0){ continue; }
if(oSlot.itemid == 46107){ continue; }
var oItem = ITEMS.Item(oSlot.itemid);
if(oItem.getName() == ItemName && oSlot.num >=num){
return oSlot;
}
}
return false;
}
function WantToSale(itemname,num){
var s = FindItemInSlotByQty(ItemName,num)
if(s){
ts.Sale(s.slot,num)
}
}
function MonsterAlive(){
n = 0
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i)
if(onpc.HP > 0 ){
n++;
}
}
return n;
}
function findMonster(){
maxhp = 0
mi = 0
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i)
if(onpc.HP > 0 ){
if(onpc.MAXHP > maxhp){
maxhp = onpc.MAXHP
mi = i
}
}
}
return ts.oNPCCombat.Item(mi)
}
function findMonsterName(monName){
mi = 0
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i)
if(onpc.HP > 0 ){
if(NPC.Item(onpc.uID).charname == monName){
mi = i
}
}
}
return ts.oNPCCombat.Item(mi)
}
function findMaxLevelMonster(){
maxlv = 0
mi = 0
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i)
if(onpc.HP > 0 ){
if(onpc.lv > maxhp){
maxlv = onpc.lv
mi = i
}
}
}
return ts.oNPCCombat.Item(mi);
}
function GetNpcObj(row,col){
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i);
if(onpc.Row == row && onpc.Col == col){
return onpc;
}
}
return findMonster();
}
function SelectF1Target(){
objPos = new Array()
objPos[0] = 0;
objPos[1] = 0;
maxLevel = 0;
monsterpattern = new Array()
monsterpattern[0] = 0;
monsterpattern[1] = 0;
for(i=0;i<ts.oNPCCombat.Count ;i++){
onpc = ts.oNPCCombat.Item(i);
if(onpc.Row == 0 && onpc.HP > 0){
monsterpattern[0] += Math.pow(2,onpc.Col);
}else if(onpc.Row == 1 && onpc.HP > 0){
monsterpattern[1] += Math.pow(2,onpc.Col);
}
}
for(i=0;i<=1;i++){
for(j=2;j<=5;j++){
ptt = 3 << (j-2);
if((monsterpattern[i] & ptt ) == ptt){
objPos[0] = i;
objPos[1] = j-1;
return GetNpcObj(objPos[0],objPos[1]);
}
}
}
return findMonster();
}
function SkillID(skname){
return SKILL.GetId(skname);
}
function BasicAttack(){
ts.SendAttack(Character.Row,Character.Col,Target.Row,Target.Col,SkillID(Skill))
}
// ---------- [ Menu Option (ห้ามแก้ไข) ] ----------
Timer.Enabled = true;
frm.mnuEnableReconnect.Checked = true;
frm.mnuSystray.Checked = true;
frm.mnuAutoEat.Checked = false;
frm.mnuAvoid9am.Checked = true;
// ----------------------------------------------------------------------------------------------------
debug("Common.txt -- loaded successful !!",0x00AA00);
// ----------------------------------------------------------------------------------------------------
var Wrong = new ActiveXObject("Scripting.Dictionary" [Wink] ;
function ChatClear(){
Chat.obj.text = "";
}
function DisplayClear(){
Display.text = "";
}
function WriteLog(Fname,data){
var ForAppending = 8;
var fso = new ActiveXObject("Scripting.FileSystemObject" [Wink] ;
var a = fso.OpenTextFile(Fname, ForAppending, true, false);
a.WriteLine(data);
a.Close();
}
function ClearLog(Fname){
var ForWriting = 2;
var fso = new ActiveXObject("Scripting.FileSystemObject" [Wink] ;
var a = fso.OpenTextFile(Fname, ForWriting, true, false);
a.WriteLine("" [Wink] ;
a.Close();
}
function Cdebug(message,color) {
Chat.obj.SelStart = Chat.obj.text.length
Chat.obj.SelLength = 0
Chat.obj.SelColor = color // set color
Chat.obj.SelText = "\n" + message // append message to richtextbox
}
function get_random(min,max) {
var ranNum= min + Math.round(Math.random()*(max-min));
return ranNum;
}
function Sit(direction){
ts.SendAction(45+direction)
}
function FindItemInSlot(ItemName){
for(var i=1;i<=25;i++){
var oSlot = ts.MyItems(i);
if( oSlot.itemid == 0){ continue; }
if(oSlot.itemid == 46107){ continue; }
var oItem = ITEMS.Item(oSlot.itemid)
;
if(oItem.getName() == ItemName){
return oSlot;
}
}
return false;
}
function FindItemInSlotByQty(ItemName,num){
for(var i=1;i<=25;i++){
var oSlot = ts.MyItems(i);
if( oSlot.itemid == 0){ continue; }
if(oSlot.itemid == 46107){ continue; }
var oItem = ITEMS.Item(oSlot.itemid);
if(oItem.getName() == ItemName && oSlot.num >=num){
return oSlot;
}
}
return false;
}
function WantToSale(itemname,num){
var s = FindItemInSlotByQty(ItemName,num)
if(s){
ts.Sale(s.slot,num)
}
}
function MonsterAlive(){
n = 0
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i)
if(onpc.HP > 0 ){
n++;
}
}
return n;
}
function findMonster(){
maxhp = 0
mi = 0
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i)
if(onpc.HP > 0 ){
if(onpc.MAXHP > maxhp){
maxhp = onpc.MAXHP
mi = i
}
}
}
return ts.oNPCCombat.Item(mi)
}
function findMonsterName(monName){
mi = 0
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i)
if(onpc.HP > 0 ){
if(NPC.Item(onpc.uID).charname == monName){
mi = i
}
}
}
return ts.oNPCCombat.Item(mi)
}
function findMaxLevelMonster(){
maxlv = 0
mi = 0
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i)
if(onpc.HP > 0 ){
if(onpc.lv > maxhp){
maxlv = onpc.lv
mi = i
}
}
}
return ts.oNPCCombat.Item(mi);
}
function GetNpcObj(row,col){
for(i=0;i<ts.oNPCCombat.Count;i++){
onpc = ts.oNPCCombat.Item(i);
if(onpc.Row == row && onpc.Col == col){
return onpc;
}
}
return findMonster();
}
function SelectF1Target(){
objPos = new Array()
objPos[0] = 0;
objPos[1] = 0;
maxLevel = 0;
monsterpattern = new Array()
monsterpattern[0] = 0;
monsterpattern[1] = 0;
for(i=0;i<ts.oNPCCombat.Count ;i++){
onpc = ts.oNPCCombat.Item(i);
if(onpc.Row == 0 && onpc.HP > 0){
monsterpattern[0] += Math.pow(2,onpc.Col);
}else if(onpc.Row == 1 && onpc.HP > 0){
monsterpattern[1] += Math.pow(2,onpc.Col);
}
}
for(i=0;i<=1;i++){
for(j=2;j<=5;j++){
ptt = 3 << (j-2);
if((monsterpattern[i] & ptt ) == ptt){
objPos[0] = i;
objPos[1] = j-1;
return GetNpcObj(objPos[0],objPos[1]);
}
}
}
return findMonster();
}
function SkillID(skname){
return SKILL.GetId(skname);
}
function BasicAttack(){
ts.SendAttack(Character.Row,Character.Col,Target.Row,Target.Col,SkillID(Skill))
}
// ---------- [ Menu Option (ห้ามแก้ไข) ] ----------
Timer.Enabled = true;
frm.mnuEnableReconnect.Checked = true;
frm.mnuSystray.Checked = true;
frm.mnuAutoEat.Checked = false;
frm.mnuAvoid9am.Checked = true;
// ----------------------------------------------------------------------------------------------------
debug("Common.txt -- loaded successful !!",0x00AA00);
// ----------------------------------------------------------------------------------------------------