• My Pages
  • Comments
  • Add Link
  • Subscribe
  • Subscribe User
  • Edit (GUI)
  • Edit (Text)
  • Rename Page
  • Copy Page
  • Load Page
  • Save Page
  • Delete Page
  • Attachments
  • Check Spelling
  • Diffs
  • Info
  • Revert to this revision
  • XML
  • Render as Docbook
  • Print View
  • Raw Text
  • Delete Cache
  • Like Pages
  • Local Site Map
  • Remove Spam
  • Package Pages
  • Sync Pages

    Usage:

    call "Filename.txt"

    Example:

    call "UseItems.txt"
    call "http://yourdomain.com/yourfile.txt"

    This will command the bot to run a script from a file or URL. The called script can access regular variables, but names like %var% will not be passed. If the called script reaches its last line, the control is passed to the calling script. Alternatively, "return" can be used to return from the called script.

    An example of how you might use this command would be to place the following script in one city on each account:

    label autorun
    call "UseItems.txt"

    And then create a file named UseItems.txt with the following script inside:

    // Use Items Script!
    // By KINGTECH, I think
    
    item = "player.box.gambling.3"
    gosub useitems
    item = "player.item.giftofthewisemystics"
    gosub useitems
    item = "player.item.sinterklaasscookies"
    gosub use5items
    goto EOS
    
    label useitems
    numberOfItems = m_context.ItemCount(item)
    echo "I have "+numberOfItems+" "+item
    if numberOfItems execute "useitem " + item
    if numberOfItems execute "repeat " + numberOfItems
    return
    
    label use5items
    numberOfItems = m_context.ItemCount(item)
    echo "I have "+numberOfItems+" "+item
    if numberOfItems execute "useitem " + item
    if numberOfItems execute "repeat " + min(numberOfItems,5)
    return
    
    /// End Of Script
    label EOS
    echo "All done!"

    The above example is for the 2013 Christmas promotion. Each time a new holiday or promotion comes along, you can edit the items to be used at the top. Each time your bots get restarted, they will use up the available items without you having to individually edit each one or run the script in each one.

    There are of course many more uses for the Call command, the above is just one example.


    ScriptControlStructures

    Call (last edited 2014-01-03 03:52:50 by Inanna)