What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Help] Fighting with playerlevel

LiquidAtoR

Community Developer
Joined
Jan 15, 2010
Messages
1,430
Reaction score
52
[Solved] Fighting with playerlevel

As title says.
I'm fighting with the playerlevel.

I need the playerlevel mulitplied by 5 (it's for the lockpicking thing I asked about earlier) and for the love of god I can't get to it.
It keeps bitching me that I can't compare a WowPlayer with a int or something alike (it's in dutch anyways).

Anyone that could guide me in the right direction here?

I need lockpickSkill = Playerlevel * 5 (so lockpickSkill is a int value).

I am probably too tired to see it, because I'm sure it's something stupidly simple :confused:
 
Last edited:
Wrap the playerlevel*5 inside an IntParse()
I know it's something like that...
If using visual studio open up the defended on the right, double click on one.
Then search on the left for intparse or int and you'll find it :)

If you can't find it then attach that part if the code
 
You will probably not believe me if I say I write in Notepad ++ :D
 
I do.
I did for about 20 minutes, then got pissed an needed the API access. Not to mention in-line debugging.
You can get the free version of studio and just register it. Doesn't cost anything, choose the option for personal use.
Let me know how it goes :)
 
You will probably not believe me if I say I write in Notepad ++ :D

I'd firstly tell you, your ballsy, yet archaic for attempting to do so. Secondly, i'll give you what your looking for:

Code:
var lockPickingLevel = StyxWoW.Me.Level*5;
 
I'd firstly tell you, your ballsy, yet archaic for attempting to do so. Secondly, i'll give you what your looking for:

Code:
var lockPickingLevel = StyxWoW.Me.Level*5;

mhm, that did it, thanks.

Here's a untested result for the rogues amongst us that would like to have their junkboxes opened while levelling.
It compiled, and that's generally a good start for notepad coders, hahaha.
Technically it should open the boxes depending on the lockpicking skills.
For that I actually wanted a API function, but this should work around the missing thing.
I doubled the list with box ID's and needed skills in a row.

Probably it can do with some more optimalisation, and it definately needs testing :p
That I will do tomorrow as the matches aint holding out much longer ;)
Then I will also release it proper after some testing about.

Thanks again for thinking along Smarter and no1knowsy.

Regards, Liquid.
 

Attachments

mhm, that did it, thanks.

Here's a untested result for the rogues amongst us that would like to have their junkboxes opened while levelling.
It compiled, and that's generally a good start for notepad coders, hahaha.
Technically it should open the boxes depending on the lockpicking skills.
For that I actually wanted a API function, but this should work around the missing thing.
I doubled the list with box ID's and needed skills in a row.

Probably it can do with some more optimalisation, and it definately needs testing :p
That I will do tomorrow as the matches aint holding out much longer ;)
Then I will also release it proper after some testing about.

Thanks again for thinking along Smarter and no1knowsy.

Regards, Liquid.

It is not very efficient to have a loop like that inside pulse. If you don't mind, i'll re-write this in my own image and submit it to you :-D.

Code:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using Styx;
using Styx.Helpers;
using Styx.Logic.Combat;
using Styx.Plugins.PluginClass;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;


namespace Lockbox
{
    public class LockboxPicker : HBPlugin
    {
        private readonly WaitTimer _lockPickTimer = WaitTimer.FiveSeconds;
        private readonly LocalPlayer _me = StyxWoW.Me;
        private readonly int _lockPickingSkill = StyxWoW.Me.Level*5;
        
        #region Lockboxes
        private readonly Dictionary<uint, int> _lockBoxes = new Dictionary<uint, int>();
        public LockboxPicker()
        {
            _lockBoxes.Add(4632, 1); //Ornate Bronze Lockbox (Skill 1)
			_lockBoxes.Add(4633, 25); //Heavy Bronze Lockbox (Skill 25)
			_lockBoxes.Add(4634, 70); //Iron Lockbox (Skill 70)
			_lockBoxes.Add(4636, 125); //Strong Iron Lockbox (Skill 125)
			_lockBoxes.Add(4637, 175); //Steel Lockbox (Skill 175)
			_lockBoxes.Add(4638, 225); //Reinforced Steel Lockbox (Skill 225)
			_lockBoxes.Add(5758, 225); //Mithril Lockbox (Skill 225)
			_lockBoxes.Add(5759, 225); //Thorium Lockbox (Skill 225)
			_lockBoxes.Add(5760, 225); //Eternium Lockbox (Skill 225)
			_lockBoxes.Add(31952, 325); //Khorium Lockbox (Skill 325)
			_lockBoxes.Add(43622, 375); //Froststeel Lockbox (Skill 375)
			_lockBoxes.Add(43624, 400); //Titanium Lockbox (Skill 400)
			_lockBoxes.Add(45986, 400); //Tiny Titanium Lockbox (Skill 400)
			_lockBoxes.Add(68729, 425); //Elementium Lockbox (Skill 425)
            
            // The boxes you can pickpocket from mobs


			_lockBoxes.Add(16882, 1); //Battered Junkbox (Skill 1)
			_lockBoxes.Add(16883, 70); //Worn Junkbox (Skill 70)
			_lockBoxes.Add(16884, 175); //Sturdy Junkbox (Skill 175)
			_lockBoxes.Add(16885, 250); //Heavy Junkbox (Skill 250)
			_lockBoxes.Add(29569, 300); //Strong Junkbox (Skill 300)
			_lockBoxes.Add(43575, 350); //Reinforced Junkbox (Skill 350)
			_lockBoxes.Add(63349, 400); //Flame-Scarred Junkbox (Skill 400)
        }
        #endregion




        public override void Pulse()
        {
            if (_lockPickTimer.IsFinished)
            {
                if (_me.FreeNormalBagSlots >= 2)
                {
                    var lockBoxesInBag = _me.BagItems.Where(o => _lockBoxes.ContainsKey(o.Entry));
                    var unlockBoxes = lockBoxesInBag.Where(o => _lockPickingSkill >= _lockBoxes[o.Entry]);


                    if (SpellManager.CanCast(1804))
                    {
                        var item = unlockBoxes.FirstOrDefault();


                        SpellManager.Cast(1804);
                        Lua.DoString("UseItemByName(\"" + item.Name + "\")");
                        StyxWoW.SleepForLagDuration();
                        Logging.Write(Color.FromName("DarkRed"), "[Lockboxer]: Unlocking and opening a {0}.", item.Name);
                        Lua.DoString("UseItemByName(\"" + item.Name + "\")");
                        StyxWoW.SleepForLagDuration();
                    }
                }
                _lockPickTimer.Reset();
            }
        }


        public override string Name
        {
            get { return "Lockboxer"; }
        }


        public override string Author
        {
            get { return "Smarter"; }
        }


        public override Version Version
        {
            get { return new Version(0, 0, 1, 0); }
        }
    }
}

This will check for Lockboxes every 5 seconds or whatever interval you set it to. It will also only do One Lockpick per Pulse (when the timer is up). :-D
 
Last edited:
To be honest i don't understand what might be the possible problem.

StyxWoW.Me.Level returns value of type 'int'
5 is also type 'int'
StyxWoW.Me.Level * 5 is still 'int'
so there is no way
PHP:
 int lockPickLevel = StyxWoW.Me.Level * 5;
would not work, unless you misspelled something
 
He didn't know the StyxWoW.Me.Level call I'm assuming.
He is using NotePad++.
Not his fault.
 
:O
Thanks for the support Apoc! lul


haha, you do realize you just called him dick in dutch ('lul') :D

Yeah yeah, I know N++ is my fault, soo... sue me :D :D
But then again coding aint my strongpoint (just can't seem to warm up to it).
One time I started to read a book on it, but after 15 minutes I went to bed.
I prefer websites if any line at all since neither is my line of expertise.
But then again I'm just doing things for my own use, and if others want to use it they can ;)

I will see to it that this get's posted later today after some testing. Have to do some RL stuff first.
 
Last edited:
what the **** ... Lul means dick? ;d didnt know that!
 
I think that if you would look for it in any language where something is common, in another language is a cursing word ;)

On a sidenote @ Smarter, now that you rewrote it to a more efficient form, maybe you can release it yourself ;)
 
But then again coding aint my strongpoint (just can't seem to warm up to it).
I prefer websites if any line at all since neither is my line of expertise.
But then again I'm just doing things for my own use, and if others want to use it they can ;)

I believe this to be the largest issue in end-user development. The ability to extend this product is one of the strongest characteristics that make this product as amazing as it is. However, the ability for the average user to develop is where a major limitation is encountered. I have tried many times to begin a "Logic Editor", enabling the end-user to make very logic driven profiles for enabling them to "Script" for the bot to do just what they want it to do. I modeled it after ProfessionBuddy, but found myself lacking in my ability with design an effiicent GUI's (and didn't want to steal/adapt PB's). I believe a standalone application like this would sprout massive development. A simple tree view like ProfessionBuddy helps inexperienced people see the flow of logic, and in my opinion speeds the creation of all Profiles and ensures Syntax and formatting.

GUI Idea (:-\):
qsoy2q.jpg
 
haha nice gui.. if you want to ill create you a sexy looking interface ( image ) with sexy buttons and sexy - sexy.

but since you can't make the "textbox" or "commentbox" something like that - "invisible" it will look not so sexy.
 
Last edited:
I guess that writing code is like art in a way.
Some like modern, some like landscapes and others abstract and chaotic.
It's all in the tools that one uses to create it.
The result in the end is what divides the artists from the hobbyists (like me :D).

A bit like:

Lord of War (2005) said:
Andre Baptiste Sr.: They say that I am the lord of war, but perhaps
it is you.
Yuri Orlov: I believe its "warlord."
Andre Baptiste Sr.: Thank you, but I prefer it my way
 
I guess that writing code is like art in a way.
Some like modern, some like landscapes and others abstract and chaotic.
It's all in the tools that one uses to create it.
The result in the end is what divides the artists from the hobbyists (like me :D).

A bit like:

That's a big twinky.
 
Visual Studio 2010 + C# requires close to 0 coding skill when used together :P
 
Last edited:
After a private conversation with Smarter it's decided he's gonna release this plugin (with some additions to it).
So wait for his release topic.

Regards, Liquid.
 
Back
Top