Among the scripting logic I have as needed to created these thus far:
level, getitemamount, invsize, map
Here they are if you wish to incorporate them as standardized functions:
level()
Code:
PHP Code:
public static int level()
{
return Client.Level;
}
PHP Code:
public static int getitemamount(string ItemName)
{
try
{
int ItemID;
bool isItemID = Int32.TryParse(ItemName, out ItemID);
int count = 0;
foreach (COFarmerItem i in Client.Inventory.Items)
{
if (isItemID == false && i.Attributes.Name.ToLower() == ItemName.ToLower()) count++;
if (isItemID == true && i.Attributes.TypeID == ItemID) count++;
}
return count;
}
catch (Exception exception)
{
Client.Chat("Error: " + exception.Message, ChatMode.System, COFarmerPacketSource.FromServer, "ALL");
return -1;
}
}
PHP Code:
public static int invsize()
{
return Client.Inventory.Items.Count();
}
PHP Code:
public static int map()
{
if (Client.MapID == Client.DynamicMapID)
{
return Client.MapID;
}
else
{
return Client.DynamicMapID;
}
}






