Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
[C#] Potion User
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: [C#] Potion User

  1. #1

    [C#] Potion User

    PHP Code:
    Item gmp = new Item(clientTibia.Constants.Items.Potion.GreatManaPotion.Id);
                
    Item smp = new Item(clientTibia.Constants.Items.Potion.StrongManaPotion.Id);
                
    Item mp = new Item(clientTibia.Constants.Items.Potion.ManaPotion.Id);
                
    String potiontype = (textBox11.Text);
                if ((double)
    client.Player.Mana client.Player.ManaMax int.Parse(textBox9.Text) > int.Parse(textBox10.Text)) 
                {
                    (
    potiontype).useonself();
                } 
    I came down to this when i were fixing some for my bot.
    Got total brainfreeze haha

  2. #2
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: [C#] Potion User

    Use a switch-case for this, like so:
    [code=c#]
    switch (textBox11.Text)
    {
    case "MP":
    mp.useonself();
    break;
    // fill in SMP and GMP
    }
    [/code]

    I'm assuming this will send a hotkey packet.

  3. #3

    RE: [C#] Potion User

    Cheers dude![hr]
    Error 2
    Code:
    Only assignment, call, increment, decrement, and new object expressions can be used as a statement	C:\Users\comp0wn\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs	116	25	WindowsFormsApplication1
    hmm...

  4. #4
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: [C#] Potion User

    Quote Originally Posted by Haard
    Cheers dude![hr]
    Error 2
    Code:
    Only assignment, call, increment, decrement, and new object expressions can be used as a statement	C:\Users\comp0wn\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form2.cs	116	25	WindowsFormsApplication1
    hmm...
    Code?

  5. #5

    RE: [C#] Potion User

    PHP Code:
    Item gmp = new Item(clientTibia.Constants.Items.Potion.GreatManaPotion.Id);
                
    Item smp = new Item(clientTibia.Constants.Items.Potion.StrongManaPotion.Id);
                
    Item mp = new Item(clientTibia.Constants.Items.Potion.ManaPotion.Id);
                if ((double)
    client.Player.Mana client.Player.ManaMax int.Parse(textBox9.Text) > int.Parse(textBox10.Text)) 
                {

                    switch (
    textBox11.Text)
                    {
                        case 
    "GMP":
                            
    gmp.UseOnSelf;
                            break;
                        case 
    "SMP":
                            
    smp.UseOnSelf;
                            break;
                        case 
    "MP":
                            
    mp.UseOnSelf;
                            break;
                        
    // fill in SMP and GMP
                    
    }
                } 
    My apologies!

  6. #6
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: [C#] Potion User

    UseOnSelf is a method, not a property.

  7. #7

    RE: [C#] Potion User

    edit - Fixed!

    Thanks blaster!
    Just a little question do you think i should use any threading or something or do you think it will work out without?

  8. #8
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191

    RE: [C#] Potion User

    Considering that you are a beginner, timers will do fine for now.

  9. #9

    RE: [C#] Potion User

    Okey thanks dude.

  10. #10

    RE: [C#] Potion User

    PHP Code:
    private void button6_Click(object senderEventArgs e)
            {
                
    Player player client.GetPlayer();
                
    player.Light Tibia.Constants.LightSize.Full;
                
    player.LightColor Tibia.Constants.LightColor.White;
            } 
    causes

    >
    PHP Code:
    utsuts.exe!WindowsFormsApplication1.Form3.button6_Click(object senderSystem.EventArgs eLine 55    C
    Do i need to set the Tibia Clients Version or whats going on?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •