Jump to content


Photo

Shadowbane: If a string says X, then Y. Else If String says A then B.


  • Please log in to reply
13 replies to this topic

#1 Stabby

Stabby

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 10 February 2019 - 05:54 PM

Hello, I am attempting to make a bot that can summon a player after receiving a specific string in a whisper on Shadowbane

Essentially I need for it to press F6 after receiving the whisper "Evac" and press F2, F3, F4, and F5 after receiving the whisper "Buff"

 

The easiest way to do it would be to just pull the color of the text. If the text is red, it means you have received a whisper. However then I get lost when determining what the string/whisper sent to me states.

 

So far this is what I have, and should theoretically work for summoning anyone who whispers you. However I would like to be able to determine if the person is wanting buffs, which would then press F2 - F5 on them. Or if they need a summon, which would then just copy their name, press F6 for summon, and then paste it and enter to summon.

 

SetActiveWindow Shadowbane
Loop 1
delay 100
IsRed  943,1393 //Checks to see if I have received a whisper
     Keydown r .2 sec //To respond to the whisper
    Delay 100
  Keydown {LEFT} 5 sec //To scroll all the way to the left
  Loop 5
      Keydown {DEL} //Deletes /tell
      End
    //Keys ~ {RIGHT} //In theory copies the person's name
    //Keys ^ C
    //Keys {F6}

    //Keys ^ V

    //Keys {ENTER}
    Else
    delay 180 sec
    end
    end



#2 Ego

Ego

    Insane Poster

  • Moderators
  • 431 posts
  • LocationAustralia

Posted 10 February 2019 - 11:32 PM

Is evac in same place in a window every time?

and

is buff in same place in a window every time? 

 

Can you use snippet to post a cut screenshot?

 

 

Do you have a link?

I'll d/l the game and have a look, thinking using objects, but need to see game in action. Below is what I have in mind

 

SetActiveWindow Shadowbane
delay 1 sec
call wisper
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
procedure wisper
  delay 2 sec
  loop (number) // or while 1 = 1
    isobject wisper at xxx, yyy
      //do something below
      isobject evac at xxx, yyy
        //do something here
        isobject buff at xxx, yyy
          //do something here
          isobject summon xxx, yyy
            //do something here
          End
        End
      End
    Else
      delay 180 sec // delay for??
    End
  End
End

 

By not using a MousePos, the code will run in the background and when an object is detected, the code will do what is requested.

Will stop a player doing what they were attempting to do, to run the code.


Ego is not a dirty word


#3 Stabby

Stabby

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 11 February 2019 - 02:33 AM

Where to download and easy levelling build

____________________________________

You can download the launcher from http://www.magicbane.com/ and scroll all the way to the bottom.

Can download the game from https://onedrive.liv...FE0F04A69D737  

Then just drag the launcher into the file from the onedrive, run the Magicbane application, and you should be good to go. You may need to make an account on the magicbane forums located Here: http://magicbane.com...p?mode=register

 

In order to get summon you need to get any healer to level 25. Think it is about 1 or 2 GB tops for the game. It is completely free to play and you can run multiple clients at once.

 

For an easier leveller, I would make a human rogue. On the right side you should have a + - for every stat. Take 5 points out of all of them. Then take the following runes: Eyes of the eagle, Lucky, Precise, Raised in the woods, Born of the Taripontor, Taught by Master Thief, And Lightning Reflexes. This will give you a lot of dexterity and bow skill, which dexterity raises your defence and bows are easy for range. On the right side on the bottom, for your kit, I would take a bow. And then go forth.

 

What you requested

_____________________________________

I have attached a photo of what the summon box and person asking for an Evac look like in game. Due to the different lengths of character names, the text for Evac and Buff would be in generally the same spot, however may be further to the left or right depending on the names of the people. It is actual text so I am not sure if objects would work. The summon box that pops up can be moved, but you can copy and paste in game. So copying someone's name from the chat box, pressing F7 to use the summoning skill, and then pasting with ctrl V would work, so long as that is what the person wants.

 

Note, there is chat logging on the game. If you click on any chat box in the top right, there should be a square. You can then set the channels for the chat box to only be /whispers. And you can enable chat logging on it. So one thing that may be plausible is whenever a pixel turns red, meaning you received a whisper, is to log the chat, and then where you have the game installed there should be a chat log folder. In the folder there should be a notepad doc with the log that came in. See attached .txt. And then see if the whisper contents says Evac or buff. Not sure if that is plausible with ACTOOLS or not. (It does look like there is a FileRead command).

 

Changes to what you made:

______________________________________________________

 

 

// This line is necessary to select the proper window
SetActiveWindow Shadowbane
delay 1 sec
call whisper
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
procedure whisper
  delay 2 sec
  loop 1
      isobject evac at 988, 1393 // 988, 1393 is the pixel coordinates of the capital H in Heelies from the screen shots.
        Keydown R .5 sec //Auto reply
        Keydown {LEFT} 3 sec //Positions the line to delete next
        Keys {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} //Deletes the /Tell that is auto generated when making a reply
        Keydown ~{RIGHT} 3 sec // Highlights requestor's name
        Keys ^ C //Copies the requestor's name
        Keydown {F7} .5 sec //Presses the summon button
        Keys ^ V //Pastes the person's name who sent the Evac//Summon request
        Keydown {Return} .5 sec //Presses the Checkbox on the summon to activate it
        Delay 9 sec       
        isobject buff at 988, 1393
          Keydown {Left Bracket} // Targets nearest ally
          Keydown {F2} .5 sec //Casts defence buff
          Keydown {F3} .5 sec //Casts dexterity buff
          Keydown {F4} .5 sec //Casts Intellegence buff
          Keydown {F5} .5 sec //Casts Strength buff
          Keydown {F6} 3 sec //Casts attack speed buff
          End
        End
      End
    Else
      delay 180 sec // delay for??
    End
 

Attached Files



#4 Stabby

Stabby

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 11 February 2019 - 02:37 AM

Noticed that the whisper example was a bit small in the previous photo, here is a more close up.

Attached Files



#5 Stabby

Stabby

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 14 February 2019 - 05:20 PM

Done some googling and some tweaking and in theory this should work so long as I can get around an error. Could not find a variable in IF: Tell = Evac or evac or EVAC conditional.

Sorry if it is messy, or if there are things that are clearly wrong. I haven't done coding in 8+ years and only used java.

 

Heres the code so far ::

 

// This line is necessary to select the proper window
SetActiveWindow Shadowbane
delay 1 sec
call whisper
set evac = "evac"
set Evac = "Evac"
set EVAC = "EVAC"
set Buff = "Buff"
set buff = "buff"
set BUFF = "BUFF"
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
procedure whisper
  delay 2 sec
  loop 1 // or while 1 = 1
      isred 988, 1393 //Checks to see if I have received a message
          Keys /Log {Return} //Makes the game save the chat log containing the latest message
                FileOpen txt, C:\Users\Razer\Desktop\Shadowbane - MagicBane\Logs\Tells.txt //Opens the Log with the message
                FileAppend Tells.txt //Moves the cursor to the end of the .txt file
                Keydown {Left} .5 sec //puts the cursor on the end of the requested action
                    loop 4
                    Keys ~{Left} //highlights the request for BUFF or EVAC
                    end
              Keys ^C //copies request to clipboard
              GetClipBoard //gets clipboard
              SetClipboard = Tell //registers the clipboard as a constant variable that we can now read
                  If Tell = Evac or evac or EVAC //If the variable is an evac request
                  Keydown R .5 sec //reply to the individual
                Keydown {LEFT} 3 sec //go to the beginning of the message
                Keys {DEL} {DEL} {DEL} {DEL} {DEL} {DEL} //Delete the mandatory /tell at the beginning of the message
                Keydown ~{RIGHT} 3 sec //Highlight the individual's name
                   Keys ^C //Copy their name
                Keydown {F7} .5 sec //press the summon button
                   Keys ^V //Paste the individual's name in the summon window
                Keydown {Return} .5 sec //Summon the person
                   Delay 9 sec //delay for cast time
        Else if Tell = "Buff" or "buff" or "BUFF" //if they are requesting a buff
          Keydown {Left Bracket} //target nearest ally
          Keydown {F2} .5 sec //buff
          Keydown {F3} .5 sec //buff
          Keydown {F4} .5 sec //buff
          Keydown {F5} .5 sec //buff
          Keydown {F6} 3 sec //buff
          End
        End
      End



#6 Stabby

Stabby

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 14 February 2019 - 05:22 PM

Also, side note. I am not planning for this to necessarily run in the background. I have a separate older computer that I am planning to run this code on, so it doesn't entirely matter if the windows are up all the time.



#7 Ego

Ego

    Insane Poster

  • Moderators
  • 431 posts
  • LocationAustralia

Posted 14 February 2019 - 10:49 PM

Every time I d/l shadowbane I get some silly game, will keep hunting for the right one, the onedrive link gives me a 'oops' error.


Ego is not a dirty word


#8 Stabby

Stabby

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 15 February 2019 - 12:20 AM

I'll try uploading my entire folder into a google drive and will post a link. Hopefully that works



#9 Stabby

Stabby

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 15 February 2019 - 12:20 AM

https://drive.google...iARom1pOJYT5HMn

 

Try that and let me know.



#10 DaMOB

DaMOB

    Lord of the Forums

  • Moderators
  • 3,119 posts
  • Locationm

Posted 15 February 2019 - 06:47 AM

Shadowbane is still a thing?


PM me and face the consequences if you are arguing, trolling, begging, or just being an all around ass.

 

4:35pm, Central Time, Feb 7, 2013...A date which will always be a day from hell for me.  I love you honey and may you rest in peace.


#11 Stabby

Stabby

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 15 February 2019 - 07:15 PM

It sort of is, Theres 2 main emulators going at the moment. Shadowbane Emulator and Magic Bane. I prefer Magic Bane since its more like old school SB.



#12 Ego

Ego

    Insane Poster

  • Moderators
  • 431 posts
  • LocationAustralia

Posted 16 February 2019 - 05:09 AM

Ok. Downloading from your link now.


Ego is not a dirty word


#13 DaMOB

DaMOB

    Lord of the Forums

  • Moderators
  • 3,119 posts
  • Locationm

Posted 16 February 2019 - 07:13 AM

It sort of is, Theres 2 main emulators going at the moment. Shadowbane Emulator and Magic Bane. I prefer Magic Bane since its more like old school SB.

Amazing that it still is.


PM me and face the consequences if you are arguing, trolling, begging, or just being an all around ass.

 

4:35pm, Central Time, Feb 7, 2013...A date which will always be a day from hell for me.  I love you honey and may you rest in peace.


#14 Ego

Ego

    Insane Poster

  • Moderators
  • 431 posts
  • LocationAustralia

Posted 16 February 2019 - 02:09 PM

tried your link, after 8 errors that required .dlls the last was an unknown error, so I'm trying a different download from Skidrow.


Ego is not a dirty word