Jump to content



VaultBoss

Member Since 02 Jan 2012
Offline Last Active Aug 03 2013 04:09 PM
-----

#79265 Define - Command / Function ?

Posted by VaultBoss on 16 June 2013 - 11:57 AM

A simple define (command) is the equivalent of a sub-routine that performs code and affects data for variables/list/tables that are set as Global inside its container, w/o returning ANY result at all per se = it is only a series of commands that repeat themselves.

The function version of the define, is a series of commands that will return ONE variable value, the one specified by the RETURN command within its code.

That makes it very useful.

 

Personally, I only use functions, even when there is no particular output that I need from the define, but at least I return a false/true value as a measure of the functions' ability to perform all the code it was supposed to.

 

EXAMPLE

 

Many people use a simple DEFINE (as a command) for a signup or signin/login to a site

 

I prefer to use a FUNCTION instead, that returns the true/false value, telling the calling main program that the function was able to execute correctly (logged in successfully, or created an account successfully, etc...)

 

Makes more sense now?




#79257 Noob questiion- about next list item..

Posted by VaultBoss on 16 June 2013 - 11:08 AM

When you added a new item to list inside the cycle, you basically moved the list index to point to that last item you added.

 

Say, initially the list index was 0 (you added the first item outside the loop)

Inside the cycle, the next list manipulation you perform is to add yet another list item (will take position with index # 1 now)

 

AFTER that, you load that list item correctly with the first load html BUT AT THE SAME TIME the list index is moving forward, now pointing to item #2 (non-existent yet, but it doesn't affect program flow because you're not doing anything with it yet)

 

However, when repeating the cycle, you now add again this new list item that you create, to the CURRENT position in the list index (that was previously set by $next list item) + 1 >>> so now, the list index will be pointing to 2+1=3 and the index #2 is left empty...

 

When you try calling that list item to display with load html, there is an empty item there (pos #2) so nothing to display, while the command itself also increment moving forward once again... and so forth...

 

As you can see, the logic flow will become harder and harder to follow - which is why I said, just DUMP that command already and simply use $list item instead which gives you perfect positioning and control.

 

Just sayin'...




#79250 [SELL] HTTP POST plugin + Crazy Bonuses Inside

Posted by VaultBoss on 16 June 2013 - 09:23 AM

Aymen, I must say (bromance, lol) I LOVE you(r work) man...

You are truly one of the best coders I've met on this arena. Kudos, mate!




#79242 [HowTo]..set var scope more easy

Posted by VaultBoss on 16 June 2013 - 07:06 AM

That's a smart workaround, Arno...

Personally, I prefer a replace in a text editor - but your method is very good too. Kudos!




#79063 Looking for a Gentleman to script me a Dutch Ebay Bot

Posted by VaultBoss on 12 June 2013 - 10:08 AM

Hmmm... not sure why you'd need a gentleman for this job, though...

Apart from the fact that we are not only gentlemen in here (the male group) there are also quite a few very talented Ladies around, you know?..  lol

 

Just kiddin'.. I like your post title, tbh... but the thing remains valid, there are female coders here too. :)




#78842 uBot Newbie OOOOHHHH :)

Posted by VaultBoss on 08 June 2013 - 12:33 PM

Hey Chris.. beware of all those bots above welcoming you - LOL




#78174 Edit Pad vs Ubot

Posted by VaultBoss on 25 May 2013 - 03:55 AM

If you are building the regex programatically (load from .txt/.csv file) you need to escape the escape sign twice.

 

Example:  \n symbols new line in regex. You can copy/paste it as is in Node View, but if you are to paste in Code View, you need to have it like this:  \\n

 

Same with \s -> \\s or \. -> \\. etc...




#78167 How do you start with a new project?

Posted by VaultBoss on 25 May 2013 - 01:32 AM

He's right... re-using already wrote code for common tasks is key to become more efficient.

 

I am keeping all my defines and stuff in .txt files, but I will now assemble the most important ones in a template like malefic just said.

 

An excellent idea.

Sometimes I wanna hit my forehead for not thinking of such elementary things sooner. :)

 

Cheers, mate!




#77818 How do I 'skip' a step or 'redo' a step?

Posted by VaultBoss on 20 May 2013 - 07:24 AM

There is no equivalent to the GoTo command in UBS.

 

You need do write your own logic to fork the flow of the sequence based on your own parameters.

 

The IF THEN ELSE IF ELSE sequence, as well as LOOP WHILE will allow you to write anything you want.

 

But there is no JUMP/GO TO, if that is what you wanted...




#77713 Comparing a sender's domain with a list of allowed domains

Posted by VaultBoss on 18 May 2013 - 03:48 AM

Use a replace applied to the text/list item/table cell where you store each scraped email, using this regex:   .*@

   and replace with $nothing.  You'll be left with only what you need/want.




#77614 [TOOLS] Useful Software - Process Lasso - for 'taming' nasty, resourc...

Posted by VaultBoss on 16 May 2013 - 03:35 AM

I felt that this is worth letting all UBotters know:

 

Today, GAOTD (GiveAwayOfTheDay) website has one of THE most powerful tools to grab for free by anybody:

 

http://www.giveawayo...way of the Day)

 

I am not trying to promote GAOTD per se, although it is a very valuable resource and website, but I am sure many people here would find this piece of software extremely useful.

 

I have no affiliation with neither GAOTD, nor the sw dev for this one; just my deep appreciation of their stellar efforts to make our lives easier (and less expensive) by providing such premium, usually paid tools, for free.

 

Enjoy!




#77612 Scraping multiple attributes with REGEX

Posted by VaultBoss on 16 May 2013 - 03:06 AM

Why don't you scrape all the data (the 3 different sets) into a list and apply various data cleaning after that on the list with regex, for instance, to keep only what you need?

 

Usually, when the page you scrape is coded poorly, class/id-wise, it is best to just take as much as you can and clean things within UBS.

 

Hope this helps you...




#77442 Set + regex help please

Posted by VaultBoss on 13 May 2013 - 09:25 AM

This one would also remove the TLD from the file, if you want so:

(?<=(\\))[a-zA-Z0-9\-_]*(?=\.)

This way, your:  c:\temp\test\myfile.xxx   ---->  myfile only...




#77363 Multi-Threaded Browsing - How Do I Make It Work?

Posted by VaultBoss on 12 May 2013 - 11:02 AM

Go to your friend, Google... :P and type in the search box ALL the string below (don't just click the link):

 

site:http://www.ubotstudio.com/forum multithreading

 

This will bring up lots of related threads - where you will find the advice you're seeking, as well as video tutorials, etc...

 

Best way to start is to watch what/how other people did it already.




#77121 Looping within a list

Posted by VaultBoss on 09 May 2013 - 02:05 AM

By what you describe, you do not have a list there, but a variable containing two links, separated by a new line, which only LOOKS LIKE a list, but the two links are in fact under the same 'umbrella' so to speak.

 

Naturally, your looping will bring the same link, because it calls the same variable twice.

 

Also, like I always advocate across this forum, try to get into the habit of losing the $next list item from your daily toolset and replace that with $list item instead, to make sure you call exactly the list item/element you want.

 

In order to have your list be a real list as you want it, make sure to load it from file using $new line as the list separator in the $list from text(file), which is what I suspect you were using.

Better yet, use $add list to list, which will basically take care of it for you.

 

Hope this helps...