fr0stebyte
Member
- Joined
- Aug 16, 2012
- Messages
- 50
- Reaction score
- 0
i tried creating a simple pickup validation class, but i don't seem to be able to implement it successfuly in itemhandling.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.IO;
using GilesTrinity.Technicals;
using System.Windows.Documents;
namespace GilesTrinity
{
class PickupValidation
{
String fileRule = @"Plugins\GilesTrinity\ItemRules\pickup_rule.dis";
List<Boolean> pickupFlag = new List<Boolean>();
List<string> nameItem = new List<string>();
Boolean pickItUp = false;
private void readFile()
{
if (File.Exists(fileRule))
{
StreamReader reader = new StreamReader(fileRule);
string input = null;
while ((input = reader.ReadLine()) != null)
{
nameItem.Add(input.Split(',')[0].ToString());
pickupFlag.Add(Boolean.Parse(input.Split(',')[1]));
}
}
}
public Boolean validatePickup(GItemType itemType)
{
for (int i = 0; i < pickupFlag.Count; i++)
{
if (nameItem.Equals(itemType.ToString()) && pickupFlag.Equals(true))
{
pickItUp = true;
}
else
{
pickItUp = false;
}
}
return pickItUp;
}
public void init()
{
try
{
readFile();
}
catch (Exception ex)
{
DbHelper.Log(TrinityLogLevel.Error, LogCategory.ScriptRule, "PickupValidation File Reading failed: {0}", ex);
}
}
}
}
GItemType.Axe,true
GItemType.CeremonialKnife,true
GItemType.HandCrossbow,true
GItemType.Dagger,true
GItemType.FistWeapon,true
GItemType.Mace,true
GItemType.MightyWeapon,true
GItemType.Spear,true
GItemType.Sword,true
GItemType.Wand,true
GItemType.TwoHandAxe,false
GItemType.TwoHandBow,false
GItemType.TwoHandDaibo,false
GItemType.TwoHandCrossbow,false
GItemType.TwoHandMace,false
GItemType.TwoHandMighty,false
GItemType.TwoHandPolearm,false
GItemType.TwoHandStaff,false
GItemType.TwoHandSword,false
GItemType.Mojo,false
GItemType.Orb,false
GItemType.Quiver,false
GItemType.Shield,false
GItemType.Amulet,true
GItemType.Ring,true
GItemType.Boots,true
GItemType.Bracer,true
GItemType.Cloak,false
GItemType.Gloves,true
GItemType.Legs,true
GItemType.MightyBelt,true
GItemType.Shoulder,true
GItemType.SpiritStone,false
GItemType.VoodooMask,false
GItemType.WizardHat,false
You want it? You got it!
It'll be nice to have a drop-down menu with these options:
In my opinion it'll resolve all problems with any rules.
- Keep UNID
- Stash
- Sell
- Salvage
In addition, these settings will be saved between plugin updates so it will set us free from having to modify files manually every time.
I activated the caching debugging and reproduced the stuttering issue, but the Logs folder in Trinity only contains a debug file that shows the item rules being loaded and a log file that shows the item rules that were matched during the stashing routine. Am I missing something to log the problem correctly?
Same problem as comment #378.
While using Giles Trinity, I noticed in the basic Alkizer run profile, the bot for me gets stuck in Tower of the Cursed 1. What happens is the profile checks around for an elite in that area and happens to run past a shrine that Giles seems to recognize and want to click on (because I have it enabled to do so in Giles). When it fails to click on the shrine due to being up on higher ground, it tries to leave to the next level, but fails to do so because it gets stuck in a loop on the stairs of trying to fetch the shrine or move on. If there is no shrine, it works fine.
I tried searching for a solution to potentially blacklisting shrines in Giles Trinity but found nothing specific on the forums on how to do this. Any suggestions or solutions to fixing this?
Maybe its not even related to Giles and more so the inability for DB to get close enough to click on this shrine. Either way, I should be able to black list this, right?
Giles now manage correctly Blacklist info from profile (Same tag with or without Giles)
[ATTACH]71044.vB[/ATTACH]
It's ok and will be great! Thanks a lot =)I can pass it to develop flexible pickup system.
Not in next release, I don't have time
This file includes the stutter issue.
What happened while logging:
- force town run
- bot TPs to town for routine
- bot identifies items
- bot runs to stash
- bot runs to vendor
- bot vendors trash items
- STUTTERING HERE
- bot runs back to TP with heavy stuttering
- bot runs fine after jumping back through TP
View attachment 71045
Hi ungo!
In the latest version, 1.7.1.3, I've added some special diagnostics for troubleshooting this particular problem.
Here's what I'd like you to do and it will help me nail this down for good:
* Go to trinity config > Advanced tab
* Enable "Debug Cache System"
* Reproduce the stuttering/freezing/performance problem
* ZIP your log file and attach to this thread.
* You don't need to set your Demonbuddy log settings to 'Diagnostic' - all diagnostic logs are already logged in the log file (just not always shown in the log window).
Just a little warning, Debugging the cache system will generate a HUGE log file, so you will need to zip it before attaching.
Thanks for your help!
Giles now manage correctly Blacklist info from profile (Same tag with or without Giles)
[01:41:10.971 Q] [Trinity][CacheManagement]System.AccessViolationException: Could not read bytes from 00000008 [299]!
в Zeta.MemoryManagement.ExternalProcessReader.ReadBytes(IntPtr address, Int32 count, Boolean isRelative)
в Zeta.MemoryManagement.ExternalProcessReader.Read[T](IntPtr address, Boolean isRelative)
в Zeta.Internals.Actors.ACD.[](ACD , Int32 )
в Zeta.Internals.Actors.ACD.GetAttribute[T](Int32 attribute)
в Zeta.Internals.Actors.ACD.GetAttribute[T](ActorAttributeType attributeType)
в Zeta.Internals.Actors.DiaUnit.get_IsBurrowed()
в GilesTrinity.GilesTrinity.RefreshGilesUnit(Boolean AddToCache)
в GilesTrinity.GilesTrinity.RefreshStepMainObjectType(Boolean& AddToCache)
в GilesTrinity.GilesTrinity.CacheDiaObject(DiaObject freshObject)
в GilesTrinity.GilesTrinity.RefreshCacheMainLoop()
[01:42:53.027 Q] [Trinity][CacheManagement]System.NullReferenceException: Object reference not set to an instance of the object.
в Zeta.Internals.Actors.DiaUnit.get_IsBurrowed()
в GilesTrinity.GilesTrinity.RefreshGilesUnit(Boolean AddToCache)
в GilesTrinity.GilesTrinity.RefreshStepMainObjectType(Boolean& AddToCache)
в GilesTrinity.GilesTrinity.CacheDiaObject(DiaObject freshObject)
в GilesTrinity.GilesTrinity.RefreshCacheMainLoop()
// Rend, elites close-range only
if (!bOOCBuff && !bCurrentlyAvoiding && hashPowerHotbarAbilities.Contains(SNOPower.Barbarian_Rend) && !playerStatus.IsIncapacitated &&
(iElitesWithinRange[RANGE_12] > 0 || (CurrentTarget.IsBossOrEliteRareUnique && CurrentTarget.RadiusDistance <= 6f))
{
if (playerStatus.CurrentEnergy >= 20)
return new GilesPower(SNOPower.Barbarian_Rend, 0f, playerStatus.CurrentPosition, iCurrentWorldID, -1, 5, 5, USE_SLOWLY);
bWaitingForSpecial = true;
}