Post by mrjim on Feb 13, 2011 18:56:00 GMT -5
this script identify all item in a bag and log it in a text file LastIDbag.txt so you can find good item and grab it easily
1) open the bag (the bag must be open all time)
2) start the script and target the bag
3)wait till the end
IDbag.txt
write.js
you can check the script that i use to script this one
www.easyuo.com/forum/viewtopic.php?p=30119#30119
www.easyuo.com/forum/viewtopic.php?p=283367#283367
1) open the bag (the bag must be open all time)
2) start the script and target the bag
3)wait till the end
IDbag.txt
; =========================================
; Sub IDbag
; =========================================
set #result n/a
set #lpc 50
gosub SetTarget
set %container #LTARGETID
ignoreitem reset
set #result n/a
; =========================================
; ID
; =========================================
finditem * C_ , %container
set %totalitems #findcnt
set %itemsleft %totalitems
event sysmessage %itemsleft Item Found
IDloop:
finditem * C_ , %container
if #findkind = -1
{
wait 2s
event sysmessage DONE ! ! !! ! !
halt
}
Retry:
set #ltargetid #findid
set #ltargetkind 1
event macro 13 3
target 3s
event macro 22
gosub Journalscanbag 60
if #result = 1
{
set #result n/a
Wait 9s
Goto Retry
}
if #result = 2
{
ignoreitem #findid
set %itemsleft %itemsleft - 1
event sysmessage %itemsleft Item to ID
Wait 9s
Goto IDloop
}
event sysmessage Nothing Found Retry...
goto IDloop
; =========================================
; Sub journal scaner
; =========================================
sub Journalscanbag
set %sfjm_lpc #lpc
set #lpc 500
set %sfjm_Timer #sCnt2 + %1 ; timeout
repeat
{
gosub ScanForJournalMsg
}
until %sfjm_Timer < #sCnt2 || #result >= 1
set #lpc %sfjm_lpc
return #result
sub ScanForJournalMsg
{
for %iiJnl %sfjm_jStart #jIndex
{
scanjournal %iiJnl
if ( It_appear in #journal )
{
;Execute Wscript.exe Write.js LastIDbag.txt 1 string1 string2
; 0 owerwrite 1 samefile
Execute Wscript.exe Write.js LastIDbag.txt 1 #journal #ltargetid
return 2
}
if ( normal in #journal )
{
return 2
}
if ( sure... in #journal )
{
return 1
}
if ( It_has in #journal )
{
return 2
}
}
return 0
}
; =========================================
Sub SetTarget
event sysmessage select_target ! ! !!! !
SET #TARGCURS 1
WHILE #TARGCURS = 1
WAIT 5
return
; =========================================
write.js
var ForReading = 1, ForWriting = 2, ForAppending = 8
var WSHShell = new ActiveXObject("WScript.Shell");
var args = WScript.Arguments;
var objArgs = WScript.Arguments;
if (objArgs.length > 3)
{
var filename = objArgs(0);
var create = parseInt(objArgs(1));
var fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso)
{
var f
if (create == 1 )
f = fso.OpenTextFile(filename, ForAppending, true)
else
f = fso.CreateTextFile(filename, true);
if (f)
{
f.Write(objArgs(2));
f.Write("\r\n");
f.Write(objArgs(3));
f.Write("\r\n");
f.Write("\r\n");
}
f.Close();
}
}
you can check the script that i use to script this one
www.easyuo.com/forum/viewtopic.php?p=30119#30119
www.easyuo.com/forum/viewtopic.php?p=283367#283367