Jump to content



Photo

Help Function Or Command Titles


  • Please log in to reply
3 replies to this topic

#1 spa3212

spa3212

    Advanced Member

  • Members
  • PipPipPip
  • 77 posts
  • OS:Windows 8
  • Total Memory:2Gb
  • Framework:v3.5
  • License:Community Edition

Posted 21 January 2020 - 08:47 AM

I don't if it's possible or its already there but I couldn't find a way to set title or commands, so that one can identify what that particular command is for.

 

like I have a command of many loops but how to set its name like Loop-for login, loop for images etc, 

 

I know define can do this but other than this.



#2 PRO

PRO

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 169 posts
  • Locationeurope
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 21 January 2020 - 09:34 AM

As of my knowledge you can either:

 

- use a define in order to create a custom named chain of commands.

- just place a "comment" above your command and write within this comment.



#3 spa3212

spa3212

    Advanced Member

  • Members
  • PipPipPip
  • 77 posts
  • OS:Windows 8
  • Total Memory:2Gb
  • Framework:v3.5
  • License:Community Edition

Posted 21 January 2020 - 09:40 AM

thanks this is what I was looking.



#4 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 3275 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 21 January 2020 - 10:21 AM

If you keep your commands small, name them well, and follow a high level -> low level structure then your code will read better.

 

High level commands will just say what things do.

 

Low level commands will do the work.

 

For example to search Google you might have a high level command named SearchGoogle. This might contain a couple of commands in a loop: NavigateToSearchPage, ScrapeResults. Each of those might contain the actual logic. When you read the code you can see that it searches Google. If you need to see what that does then go to it and you will find that it loops and navigate to the pages and then scrapes the results. If you then need to dive deeper you can go down to the bottom level (NavigateToSearchPage, and ScrapeResults) which actually clicks on next page or parses the results from the page.

 

Of course this example is small you probably don't need to go this far for a small script. But when you have a larger project this makes a big difference.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users