mIRC Home    About    Download    Register    News    Help

Topic Options
#264668 - 29/12/18 07:14 PM None of my sub scripts are working
TroyL Offline
Babel fish

Registered: 04/12/18
Posts: 51
So basically this code isnt working
Code:
if (($msgtags(msg-id).key == sub) && ($msgtags(room-id).key == 30084163)) {
    var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
    var %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99, Prime, Prime)
    msg $1 /me bingAw NEW SUB!! rooAww Thank You %nick For Subscribing With A %sub-plan Sub! Welcome! bingAw rooAww
   
  }
if (($msgtags(msg-id).key == resub) && ($msgtags(room-id).key == 30084163)) {
    var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
    VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99, Prime, Prime) 
    msg $1 /me rooAww RESUB!! rooHappy %nick Has Just Resubscribed For $msgtags(msg-param-months).key Months In A Row With A %sub-plan Sub! Welcome Back! rooAww rooHappy
    
  }
if (($msgtags(msg-id).key == subgift) && ($msgtags(room-id).key == 30084163)) {  
    var %nick_from $iif($msgtags(display-name).key, $v1, $msgtags(login).key) , %nick_to $iif($msgtags(msg-param-recipient-display-name).key, $v1, $msgtags(msg-param-recipient-user-name).key)
    VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99)
    msg $1 /me rooGift GIFTED SUB!! rooGift Thank you %nick_from For Gifting A %sub-plan Sub To %nick_to $+ ! Welcome! agonySUB rooGift
   
  }
 }

it was working a few days ago and now its not

Top
#264670 - 29/12/18 07:34 PM Re: None of my sub scripts are working [Re: TroyL]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1062
you must've changed something.
try adding a line performing an echo to the status window, so you can see if the line is even being reached. also another similar line as the first command inside the :TEXT: handler. If they're not being shown to the status window, that means you've done something to disable it. most likely candidates:

1. You put another :TEXT: handler above it within the same script
2. The :TEXT: handler has the @ prefix and you're not Op
3. You disabled events handlers and typing /remote says remote events are off, in which case you can re-enable that with "/remote on"


Code:
//echo -s this debug message comes from line $scriptline of $script

Top
#264674 - 31/12/18 03:57 AM Re: None of my sub scripts are working [Re: maroon]
TroyL Offline
Babel fish

Registered: 04/12/18
Posts: 51
Could you provide an example of it? And also it started the day after i downloaded the json mirc file to get the variables for an uptime command. So could that of caused this?

Top
#264675 - 31/12/18 04:41 AM Re: None of my sub scripts are working [Re: TroyL]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1062
this looks like the code i suggested in
https://forums.mirc.com/ubbthreads.php/topics/264614/Re:_Script_Response_Time#Post264614

Do you still have those 3 lines below the line?
raw USERNOTICE:*:{
Those lines were echoing debug info to a custom @Sub window. If that code is still there, is there anything showing up in that window? If not, maybe your $msgtags(room-id).key is no longer 30084163 or there's another :USERNOTICE: event above this event handler that's stealing everything. Or maybe "/remote" says OFF.

Offhand, the only way I can think of that a JSON script would disable this would be if it contained a 'msg' that isn't working right, or if it uses :PARSELINE: to intercept server messages and replaces them with garbled text. You could temporarily uninstall the JSON script to see if the problem goes away, but I kinda doubt it's the problem.

Be sure to scout your status window for any error messages that might be related.

Top
#264684 - 01/01/19 12:10 AM Re: None of my sub scripts are working [Re: maroon]
TroyL Offline
Babel fish

Registered: 04/12/18
Posts: 51
I checked about the room id but when i use the room id code that would always work it just shows "Room ID: " then its blank.



UPDATE: SUBS AN BITS are working now

Also every time i talk in a chat, on mIRC in the status windows it keeps saying USERSTATE or ROOMSTATE

Top
#264692 - 02/01/19 03:38 AM Re: None of my sub scripts are working [Re: TroyL]
TroyL Offline
Babel fish

Registered: 04/12/18
Posts: 51
Ok so say if someone posts a link and they're not supposed to and my bot times them out, how would i give them a 5 second time out as a warning and then the next time they do it they get timed out for 600 seconds. So basically how do i code a warning system for my bot?

Top
#264693 - 02/01/19 05:51 AM Re: None of my sub scripts are working [Re: TroyL]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1062
You already have link timeout code, and you want it adapted?

Top
#264694 - 02/01/19 06:17 AM Re: None of my sub scripts are working [Re: maroon]
TroyL Offline
Babel fish

Registered: 04/12/18
Posts: 51
links were just an example but pretty much anything

Top
#264696 - 02/01/19 06:47 AM Re: None of my sub scripts are working [Re: TroyL]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1062
It could probably be adapted from the flood counter, where instead of counting how many times they say something, it would check to see if they said 'link' one time. In the action section, you would check to see if the warning flag exists. If it does not exist, you set the warning flag and give the warning. But if it does already exist, you lower the boom.

It was ambiguous if you to ban all links or exempt some. To ban a link, you'd need to come up with a definition for what that is, especially if you want to flag strings containing http or beginning with it, containing www. etc. It can get very easy to have false positives.

Top
#264701 - 03/01/19 05:16 AM Re: None of my sub scripts are working [Re: maroon]
TroyL Offline
Babel fish

Registered: 04/12/18
Posts: 51
example code of this?

Top
#264702 - 03/01/19 07:02 AM Re: None of my sub scripts are working [Re: TroyL]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1062
you didn't answer any of my questions

Top
#264707 - 04/01/19 05:52 AM Re: None of my sub scripts are working [Re: maroon]
TroyL Offline
Babel fish

Registered: 04/12/18
Posts: 51
OK this doesn't matter i figured out how to do this but my bot isnt picking up on someone doing /me so how do i put that in the on *:text:* thing?

Top