Need help rewriting "Transp 0 : 100" - colors

as everyone probably knows "Transp = is being deprecated"
I am aware of how to rewrite color.new and recode that part.
However, in a different section of a pine script I see transp = lines? 0 : 100 which in the script then allows the color and slider bar to be manipulated.
Can anyone help point me to where I can find how to rewrite this portion of the pine-script?
Thank you in advance
here are images of how the old and new code show up (old is colorful and optional, new is B/W)

transp == lines ? color.new(color.blue,100) : color.new(color.blue,10)
Its all about the condition, if it's true then trans will be 100, if not then Tran will be 10. Change trans to your liking
You can post full code and I'll correct if you not able to do it

Related

If certain thing is included in input use anything after it

Hello I am currently working on a script that goes onto a website and automatically adds an Item to cart and purchases it for you I have a script that works except the only problem is that It is only able to checkout a single Item Item. Here is an example fo the script:
Item_code = input('Item code: ')
Size = input('Size: ')
def BOT():
driver = webdriver.Chrome(executable path=
URL = .....
driver.get(URL)
while True:
try:
driver.find_element_by_css_selector(Item_code).click()
break
except NoSuchElementException:
driver.refresh()
select = Select(driver.find_element_by_id('s'))
select.select_by_visible_text(Size)
The script finds the item with the item code that I use and then selects the size from the users choice
I want to be able to write the code and the size but If I want to bot to cart two Items in different sizes I want it to type in a , and insert the next Item code and Size For example:
12345, 6789
Large, Medium
I want to somehow write that if a comma is included to read and use the code after it after it uses the first one and repeat that for every comma so If I wanted to get 3 or even 4 all I would have to do is this:
1234, 5678, 7890, etc...
Large, medium, Small, etc...
If anyone could Help me out I would really appreciate it I was thinking of something like
for , in BOT():
(something like this but Im not sure )
I know how to tell the script that if Item_code == (',') then do this but that would not work because it needs to be just the comma and I do not know how to tell it to repeat the BOT() a second time and use the second code and size
If someone could help me out I would really appreciate it thanks.
(I want to be able to share this bot since I have already made a GUI for it and all that)
(not sure if the executable path will work when sharing)
I have fixed this problem I created several custom functions and called them on special if statements
ex.
if Item.count(',') == (1):
Cart1()
Checkout()
etc.....

How to print a turtle variable equivalent to item 0 in a list in Netlogo?

I am trying to export a turtle variable value that is <= item 0 of a patch list. These are the values I am interested in recording, but I am having trouble getting the code right for that.
I've tried below:
file-print turtles with [turtlevariable <= item 0 patchlist]
I know that's not right as I am getting the number of turtles, and not the turtle variable value. I would like to run this model 1000 times and am unsure how to create code for a file that will be manageable to manipulate in Excel.
I'm pretty sure there is a simple answer, but I just can't figure it out! Any help is greatly appreciated.
You have multiple questions here. You need to post each question separately. I will take on the following: how can you get a list of values for turtlevariable, but only for the values that are < item 0 patchlist.
globals [patchlist]
turtles-own [tvar]
patches-own [pvar]
to test
ca
ask patches [set pvar random-float 1.0]
set patchlist [pvar] of patches
let _p00 item 0 patchlist ;;compute only once
crt 100
ask turtles [set tvar random-float 1.0]
let _tset (turtles with [tvar < _p00])
let _tvals [tvar] of _tset
print _tvals
end
You can always file-print anything you can print, so now you need to decide how exactly you want to format this list. This is a separate question. If you want to save as .csv, that is a separate question. (But you will find multiple questions on this site addressing that.) If you want to create one output file for multiple replicates, that is a separate question. (But see questions on this site about BehaviorSpace.) Hth.

Crystal Report 7 Alternate Row Color

I'm trying to make a report by using Crystal Report 7. But I'm having trouble when I tried to make the odd detail become white and the even detail become gray
Here what I've tried
I'm waiting for the answer. Thx
even though it's an old post, maybe some people still need it. I happen to still use cr 7, I use this logic and this works fine.
if right(totext(recordnumber / 2),2) = '00' then White else Black
if right(totext(recordnumber / 2),2) = '00' then true else false
Take a look at this link, this might help you.
http://victoriayudin.com/2009/03/31/alternating-shading-for-lines-in-crystal-reports/
OR
Try this:
if RecordNumber mod 2 = 0 then crWhite else crSilver.

modx Decrement a TV to obtain 0

I need my [[+idx]] tv to start at 0 instead of 1 so I tried this:
[[+idx:decr]] or [[+idx:substract=1]] but it gives me -1 (minus one).
Does anyone know another way to obtain 0?
Thank you
Using this in chunk for getImageList works (at least for me):
[[+idx:decr]]
It gives: 0,1,2,3 ....
P.S. using modx revo 2.3.1
set your template variable default to 0 when you create the variable.
What are you trying to do, your question is vague at best.
UPDATE
ok - what I think will work for you is to write a snippet to do the math... where ever you call the [[+idx]] instead write a snippet
[[!FixIDX? &itemindex=`[[+idx]]`]]
then in your FixIDX snippet just do the math with php and return the corrected index. Though perhaps a custom output modifier would be the better way to go: http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)
Though looking at the docs, your code should certainly work - I see no reason for it not to.

Theme_image() returns nothing

I'm stuck on a roadblock with the simplest of things. In Drupal 6, I'm trying to take a user-entered path to an image and output that image to the page. Here's a bit of code:
$slogan_image = theme('image', $slogan_image_path);
dpm("\$slogan_image_path = '$slogan_image_path'");
dpm("\$slogan_image = '$slogan_image'");
The devel output reads:
$slogan_image_path = '/sites/default/files/images/Family.jpg'
$slogan_image = ''
There is an image at '/sites/default/files/images/Family.jpg'; if I browse to www.mysite.com/sites/default/files/images/Family.jpg, the image will be displayed.
What am I doing wrong? Thanks.
The problem was that my path began with a slash. Drupal paths don't have that initial slash. Drupal being open source, I could look refer to the Drupal 6 api docs and see the code for theme_image included this line:
$url = (url($path) == $path) ? $path : (base_path() . $path);
showed me that Drupal would prepend my path with the base_path(). Executing that code myself, in an Execute PHP page, allowed me to see that theme_image would wind up using //sites/default/files/images/Family.jpg as the $url, clearly an illegal value.
I thought I'd append this short explanation to my trivial problem to help rank beginners see how I debugged it.

Resources