Jump to content



Biks

Member Since 19 May 2010
Offline Last Active May 26 2019 05:48 AM
-----

#118057 Lemme Crash At Your Place. (Memory Resetting?)

Posted by Biks on 25 January 2016 - 06:57 AM

I'm still having the same old issues with crashing even after trying load html($nothing). It's pretty consistent after so many iterations.

 

I guess the final solution is to restart ubot in the middle of a sequence. I've never done that.

 

Anyone have any example code of how this is done? Has someone covered this in another thread? I've done a search for "restarting", but can't find anything specific.




#19580 Easiest Email Verification : Gmail or Yahoo ?

Posted by Biks on 24 August 2010 - 09:14 PM

Aaron Nimocks did a few tutorials on building just that with Gmail and Yahoo. The simplest one is using Yahoo mobile mail:



I had just recreated what he did. The only tricky part I had was using the selection by position of the first email link.

Some others are here:

Regular yahoo mail:

Gmail:


#19453 Noobs guide to Javascript strings

Posted by Biks on 22 August 2010 - 09:54 AM

I took a whole day to figure out how to trim, delete or replace stuff using a Javascript expression within Ubot, so I figured I might as well share it. I have had not one drop of javascript programming experience, so you hot shot programmers can shrug and scoff all you want. :-) I'll try to explain this from a complete noobs perspective.

My objective: I wanted to trim down any long URL to the basic domain.
Take something like this:
http://www.ubotstudio.com/forum/index.php
Turn it into this: ubotstudio.com


You should be able to use what I show with ANY type of text string. I created a running demo of the javascript strings to show you HOW they would be used within Ubot.

Download: Attached File  Shorten URL.ubot   18.31KB   196 downloads


Posted Image

You'll enter a long URL into the UI box above, hit the play button and you'll see the results in the UI stat monitor below. The demo just shows the end result of the variable. You would use this updated variable within your own bots.

Here's everything for pattern matching characters: javascriptkit.com/javatutors/re2.shtml


--- Strip Front Tab -----


Posted Image

The flow is:
'LOOK AT ALL THIS JUNK' .replace /WHATEVER I FIND HERE/ , 'WITH THIS' ;

As a non programer, I was having a hard time figuring out where things started and ended. (/( = is this something? How about this = /, ?

The sections are:

'{1}' = your variable will be inserted here. Just {1} won't work - you need '{1}'
.replace( ); = This is the outside portion of the .replace expression.
/ / = this is an inside group
, = find the stuff to the left of the comma and replace it with what's on the right
( )|( ) = Alterations of groups - (THIS) O|R (THAT) In this instance we're looking either http:// or http://www
'' = empty or nothing. Sometime you WILL have something like '{1}' (a variable)

Notice that there are no slashes here: (http:..www.)|(http:..)
This won't work: (http://www.)|(http://)
Reason: using a / would mean the end of a section. You've got to use a . (dot)
. = match ANY single character


--- Strip End Tab -----


Posted Image

The flow is:
'LOOK AT ALL THIS JUNK' .replace /STARTING FROM THE END AND GOING BACKWARDS, SELECT EVERYTHING AND INCLUDING .COM/ , 'WITH JUST .COM' ;

In reverse order:
$ = start at the end (^ = start at the beginning)
. = ANY single character
+ = match one or more characters

.+. = any character, to any AMOUNT of characters, to any character again. This is the closest you'll come to the standard wildcard (*).

----- Strip both -----

Notice that it strips #URL first and updates #strip, then it strips #strip and updates #URL. By ping pong between variables you can keep updating your original data.

--- Other examples ----

Let's say you wanted just the authors name to a post. The narrowest scape you can do this:

Harry Kabonzi | August 20, 2010

You would run this: '{1}'.replace(/ \x7c.+.$/, '');

The tricky part is the "|" symbol. This won't work: '{1}'.replace(/ |.+.$/, ''); You need to use the hex # for the "|" symbol, which is \x7c. In this case, I'm also adding a blank space before it so I end up with only "Harry Kabonzi". To find more hex #'s, go here.

Again, check out this website for more pattern matching characters: javascriptkit.com/javatutors/re2.shtml