Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #BEGIN CLIENTCODE
- #BEGIN JAVASCRIPT
- var adblocking=0;
- function adblock(){
- var xhttp = new XMLHttpRequest ();
- xhttp.onreadystatechange = function () {
- if (this.readyState === 4 && this.status === 0)
- {
- console.log("The user is adblocking");
- // this.sendPacket('a',1) //disable functionality if user is adblocking
- VS.global.adblocking=1;
- VS.global.client.AdblockDetect(1)
- console.log(VS.global.adblocking + ' one')
- }
- // VS.client.AdblockDetect(1)
- if(this.readyState ===4 && this.status ===200)
- {
- console.log("The user is not adblocking");
- VS.global.adblocking=0;
- VS.global.client.AdblockDetect(0)
- console.log(VS.global.adblocking+ ' two')
- }
- }
- xhttp.open ("GET", "https://api.adinplay.com/libs/aiptag/assets/adsbygoogle.js", true);
- xhttp.send ();
- }
- function isAdblocking()
- {
- }
- var cpmstar_anchorad_settings = {
- poolid: 80241, //Pool ID assigned by CPMStar
- dir: 1
- };
- function callanchorad(){
- (function (d, t, s) { t = d.createElement('script'); t.type = 'text/javascript'; t.src = (d.location.protocol == 'https:'?'//server':'//cdn') + '.cpmstar.com/cached/js/anchorad_v100.pack.js'; t.async = true; s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(t, s); })(document, {}, {});
- }
- callanchorad();
- (function(zonefile) {
- var rnd = Math.round(Math.random()*999999);
- var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true;
- var proto = document.location.protocol;
- if(proto == "file:") proto = "https:"
- var host = ( proto == "https:")?"https://server":"//cdn";
- if(window.location.hash=="#cpmstarDev") host = proto+"//dev.server";
- if(window.location.hash=="#cpmstarStaging") host = proto+"//staging.server";
- s.src = host + ".cpmstar.com/cached/zonefiles/" + zonefile + ".js?rnd="+rnd;
- var s2=document.getElementsByTagName('script')[0];
- s2.parentNode.insertBefore(s, s2);
- var y=window.location.href.split('#')[0].split('').reduce(function(a,b){return(a<<5)-a+b.charCodeAt(0)>>>1},0);y=(10+((y*7)%26)).toString(36)+y.toString(36);
- var drutObj = window[y] = window[y] || {};
- window.cpmstarAPI = function(o) { (drutObj.cmd = drutObj.cmd || []).push(o); }
- }('68_48304_erigatospace'));
- //68_48304_erigatospace 170_49210_gameapi
- (function (i, w, d, p, c, e, o, a, s, t) {
- cpmstar_instreamAd = null; // global variable for instream ad
- p.poolid = 80324; // your poolid
- o.select = '#overlay'; // specify the element to overlay
- c.type = 'game';
- t = d.getElementsByTagName('script');
- sid = 'cpmstarfr' + Math.round(Math.random() * 999999);
- if (!w[i]) { w[i] = { instreamAds: [] }; s = d.createElement('script'); s.src = (d.location.protocol == 'https:' ? '//server' : '//cdn') + '.cpmstar.com/cached/js/global_v100.pack.js?poolid=' + p.poolid; s.type = 'text/javascript'; s.async = ''; t[0].parentNode.insertBefore(s, t[0]); }
- w[i].instreamAds.push(a = { params: p, config: c, events: e, overlay: o, placeholder: t[t.length - 1], scriptid: sid });
- })('cpmstarinstream', window, document, {}, {}, {}, {});
- function vidad(el) {
- console.log("Game started");
- }
- var adstuff;
- cpmstarAPI(function(api) {
- api.game.setTarget(document.body);
- });
- var game = vidad(document.body);
- var iAd = null;
- cpmstarAPI(function(api) {
- iAd = new api.game.InterstitialView("interstitial");
- iAd.load();
- iAd.addEventListener("ad_opened", function(e) {
- iAdPause();
- });
- iAd.addEventListener("ad_closed", function(e) {
- var adstuff=setTimeout(function() {iAdUnpause();},700);
- iAd.load();
- });
- });
- function displayInterstitial() {
- if(iAd && iAd.isLoaded())
- {
- iAd.show();
- console.log('show')
- }
- else if(iAd)
- {
- iAd.load();
- console.log('load')
- }
- }
- function iAdPause() {
- console.log("Reward ad started playing")
- }
- function iAdUnpause() {
- clearTimeout(adstuff);
- console.log("Reward ad finished playing")
- }
- #END JAVASCRIPT
- Client
- onConnect()
- JS.adblock()
- // this.AdblockDetect(JS.adblocking);
- onNew()
- client = this
- function AdblockDetect(x)
- if(x==1)
- World.log("The user is adblocking ADBLOCKDETECT");
- this.sendPacket('d')
- if(x==0)
- World.log("The user is not adblocking ADBLOCKDETECT");
- // this.sendPacket('a')
- // this.disableOptions()
- #END CLIENTCODE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement