viewing paste identifyall() | Athena

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
/*-----------------------------------
identifyall(<value>)
-------------------------------------
by Mumbles
-------------------------------------
Identifies all unidentified items in
user's inventory and returns the 
number of items identified.
-------------------------------------
Must have Hercules commit #24c4d53
tinyurl.com/commit-24c4d53
-----------------------------------*/
function identifyall {
    
    getinventorylist();
    
    // Loop through all inventory items
    for(.@i = 0; .@i < getarraysize(@inventorylist_id); .@i++) {
        if(!@inventorylist_identify[.@i]) { // If current item is not identified
            .@unidentified_id[.@j++] = @inventorylist_id[.@i]// Add item ID to unidentified list
        }
    }
    
    // Loop through all unidentified items
    for(.@k = 0; .@k < getarraysize(.@unidentified_id); .@k++) {
        identify(.@unidentified_id[.@k]);   // Identify all unidentified items
    }
    
    return .@k; // Return amount of items identified
    
}
 
// Example use
message strcharinfo(PC_NAME), identifyall() + " items have been identified.";
 
 
 
 
/*-----------------------------------
identifyall()
-------------------------------------
by Mumbles
-------------------------------------
Identifies all unidentified items in
user's inventory without returning
any additional values. For quick use.
-------------------------------------
Must have Hercules commit #24c4d53
tinyurl.com/commit-24c4d53
-----------------------------------*/
function identifyall {
    
    getinventorylist();
    
    // Loop through all inventory items
    for(.@i = 0; .@i < getarraysize(@inventorylist_id); .@i++) {
        if(!@inventorylist_identify[.@i]) {     // If current item is not identified
            identify(@inventorylist_id[.@i]);   // Identify current item
        }
    }
    
    return;
    
}
Viewed 895 times, submitted by mumbles.