int.Parse() menu

User Tag List

Thread: int.Parse()

Results 1 to 8 of 8
  1. #1
    trustmyfake's Avatar Member
    Reputation
    4
    Join Date
    Apr 2017
    Posts
    13
    Thanks G/R
    3/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    int.Parse()

    hey,

    how can i compare things like
    Player.Offense.CriticalHitChance.ToString("F2", CultureInfo.InvariantCulture) + "%";
    with Numbers?
    if chc => 50, i cant because its a string and when i try to convert to int thud doesnt even start for me.

    I want to draw a green dot after a player when he fits diffrent criteria

    int.Parse()
  2. #2
    prrovoss's Avatar Contributor
    Reputation
    152
    Join Date
    Jan 2013
    Posts
    420
    Thanks G/R
    23/130
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just use Player.Offense.CriticalHitChance as is
    Player.Offense.CriticalHitChance >= 50

  3. #3
    trustmyfake's Avatar Member
    Reputation
    4
    Join Date
    Apr 2017
    Posts
    13
    Thanks G/R
    3/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah i already tested this method
    if (player.Offense.AttackSpeed >= 1) return;
    but it was always false : (
    thats why i tried to convert it back

  4. #4
    prrovoss's Avatar Contributor
    Reputation
    152
    Join Date
    Jan 2013
    Posts
    420
    Thanks G/R
    23/130
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by trustmyfake View Post
    yeah i already tested this method
    if (player.Offense.AttackSpeed >= 1) return;
    but it was always false : (
    thats why i tried to convert it back
    player.Offense.AttackSpeed: Your attacks per second
    player.Offense.AttackSpeedPercent*100: Your attack speed bonus in percent as shown in your character sheet ingame
    player.Offense.CriticalHitChance: Your critical hit chance bonus in percent as shown in your character sheet ingame

    To test this you can install the debug plugin made by Jack:
    Zippyshare.com - Jack.rar

    Thats the version i used, maybe there is a newer one here:
    GitHub - JackCeparou/JackCeparouCompass: Turbo.Plugins.Jack

    create a new plugin and use this snippet:
    PHP Code:
            public void PaintWorld(WorldLayer layer)
            {
                foreach (
    IPlayer player in Hud.Game.Players)
                {
                    
    Jack.Says.Debug(player.HeroName);
                    
    Jack.Says.Debug("APS:\t" player.Offense.AttackSpeed);
                    
    Jack.Says.Debug("AR%:\t" player.Offense.AttackSpeedPercent 100);
                    
    Jack.Says.Debug("CC:\t" player.Offense.CriticalHitChance);
                    
    Jack.Says.Debug("-----");
                }
            } 
    This will display aps, ar and cc for each player in the game. but beware though, you have to be near these players for thud to know their stats. if you are too far away, this will return 0

  5. #5
    trustmyfake's Avatar Member
    Reputation
    4
    Join Date
    Apr 2017
    Posts
    13
    Thanks G/R
    3/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by prrovoss View Post
    player.Offense.AttackSpeed: Your attacks per second
    player.Offense.AttackSpeedPercent*100: Your attack speed bonus in percent as shown in your character sheet ingame
    player.Offense.CriticalHitChance: Your critical hit chance bonus in percent as shown in your character sheet ingame

    To test this you can install the debug plugin made by Jack:
    Zippyshare.com - Jack.rar

    Thats the version i used, maybe there is a newer one here:
    GitHub - JackCeparou/JackCeparouCompass: Turbo.Plugins.Jack

    create a new plugin and use this snippet:
    PHP Code:
            public void PaintWorld(WorldLayer layer)
            {
                foreach (
    IPlayer player in Hud.Game.Players)
                {
                    
    Jack.Says.Debug(player.HeroName);
                    
    Jack.Says.Debug("APS:\t" player.Offense.AttackSpeed);
                    
    Jack.Says.Debug("AR%:\t" player.Offense.AttackSpeedPercent 100);
                    
    Jack.Says.Debug("CC:\t" player.Offense.CriticalHitChance);
                    
    Jack.Says.Debug("-----");
                }
            } 
    This will display aps, ar and cc for each player in the game. but beware though, you have to be near these players for thud to know their stats. if you are too far away, this will return 0
    The problem is not that I can't display it.
    I just can't compare it with values because it has decimals.

    player.Offense.AttackSpeed gives me 1,4
    Converted to string 1.4

    Now I can't just say if >= "2,00001" or 2,00001 or 2.00001 or "2.0001" I get errors but compare with 2 work but I need decimals.

    I don't know programming it's my first time, just a logic problem here I think.

    In the end I want to check all the stats and skills a build need and if it's all fine I display an indicator.

    Thank you for your help
    I test the jack debug later
    Last edited by trustmyfake; 03-30-2018 at 06:23 AM.

  6. #6
    prrovoss's Avatar Contributor
    Reputation
    152
    Join Date
    Jan 2013
    Posts
    420
    Thanks G/R
    23/130
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
                    if (player.Offense.AttackSpeed >= 1.22)
                    {
                        
    Jack.Says.Debug("APS:\t" player.Offense.AttackSpeed);
                    } 
    this works perfectly fine for me. it only prints out the players aps IF its bigger than or equal to 1.22

  7. #7
    trustmyfake's Avatar Member
    Reputation
    4
    Join Date
    Apr 2017
    Posts
    13
    Thanks G/R
    3/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by prrovoss View Post
    PHP Code:
                    if (player.Offense.AttackSpeed >= 1.22)
                    {
                        
    Jack.Says.Debug("APS:\t" player.Offense.AttackSpeed);
                    } 
    this works perfectly fine for me. it only prints out the players aps IF its bigger than or equal to 1.22

    this works for me, thank you.


    i used this with no success
    if (player.Offense.AttackSpeed >= 1.22) return;
    Jack.Says.Debug("APS:\t" + player.Offense.AttackSpeed);

    Maybe i should watch some c# turorials on youtube.

  8. #8
    JackCeparou's Avatar Savvy ? 🐒
    Reputation
    534
    Join Date
    Mar 2017
    Posts
    588
    Thanks G/R
    51/490
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by trustmyfake View Post
    if (player.Offense.AttackSpeed >= 1.22) return;
    Jack.Says.Debug("APS:\t" + player.Offense.AttackSpeed);
    The return breaks code execution. (It exit the current method)
    Hide the Rum! --> Default theme customization 101 <--

Similar Threads

  1. String parsing
    By Siretu in forum Programming
    Replies: 0
    Last Post: 11-07-2008, 04:21 PM
  2. Replies: 8
    Last Post: 07-10-2008, 02:45 PM
  3. Final Fantasy X [Int/JPN] Problem!
    By Remahlól in forum Gaming Chat
    Replies: 0
    Last Post: 05-05-2008, 08:22 AM
All times are GMT -5. The time now is 04:51 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search